From: Matías Aguirre Date: Wed, 16 Feb 2011 05:05:48 +0000 (-0200) Subject: Google OAuth is always enabled because of anon access, small comment fix X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=803d65026e3bfe94ebafe44e1c4e7fc3ce00c013;p=django-social-auth.git Google OAuth is always enabled because of anon access, small comment fix --- diff --git a/social_auth/backends/__init__.py b/social_auth/backends/__init__.py index 0e5e31a..2d00e51 100644 --- a/social_auth/backends/__init__.py +++ b/social_auth/backends/__init__.py @@ -70,9 +70,10 @@ class SocialAuthBackend(ModelBackend): verification is made by kwargs inspection for current backend name presence. """ - # Validate backend and arguments. Require that the OAuth response - # be passed in as a keyword argument, to make sure we don't match - # the username/password calling conventions of authenticate. + # Validate backend and arguments. Require that the Social Auth + # response be passed in as a keyword argument, to make sure we + # don't match the username/password calling conventions of + # authenticate. if not (self.name and kwargs.get(self.name) and 'response' in kwargs): return None diff --git a/social_auth/backends/google.py b/social_auth/backends/google.py index 292ff36..981eb11 100644 --- a/social_auth/backends/google.py +++ b/social_auth/backends/google.py @@ -124,6 +124,11 @@ class GoogleOAuth(BaseGoogleOAuth): except AttributeError: return 'anonymous', 'anonymous' + @classmethod + def enabled(cls): + """Google OAuth is always enabled because of anonymous access""" + return True + # Backend definition BACKENDS = {