From 803d65026e3bfe94ebafe44e1c4e7fc3ce00c013 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Mat=C3=ADas=20Aguirre?= Date: Wed, 16 Feb 2011 03:05:48 -0200 Subject: [PATCH] Google OAuth is always enabled because of anon access, small comment fix --- social_auth/backends/__init__.py | 7 ++++--- social_auth/backends/google.py | 5 +++++ 2 files changed, 9 insertions(+), 3 deletions(-) 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 = { -- 2.39.5