From add4ebe8cba26f8eb3d77f15f093ccb4a9a2b4af Mon Sep 17 00:00:00 2001 From: Stephen McDonald Date: Thu, 29 Dec 2011 12:38:26 +1100 Subject: [PATCH] Cleaned up whitespace. --- social_auth/context_processors.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/social_auth/context_processors.py b/social_auth/context_processors.py index db9b051..d1e9f18 100644 --- a/social_auth/context_processors.py +++ b/social_auth/context_processors.py @@ -29,18 +29,18 @@ def social_auth_by_type_backends(request): def social_auth_by_name_backends(request): """Load Social Auth current user data to context. Will add a social_auth object whose attribute names are the names of each - provider, e.g. social_auth.facebook would be the facebook association or + provider, e.g. social_auth.facebook would be the facebook association or None, depending on the logged in user's current associations. Providers - with a hyphen have the hyphen replaced with an underscore, e.g. + with a hyphen have the hyphen replaced with an underscore, e.g. google-oauth2 becomes google_oauth2 when referenced in templates. """ keys = BACKENDS.keys() accounts = dict(zip(keys, [None] * len(keys))) - + if isinstance(request.user, User) and request.user.is_authenticated(): for associated in request.user.social_auth.all(): accounts[associated.provider.replace('-', '_')] = associated - + return {'social_auth': accounts} -- 2.39.5