Commits

Alexis Metaireau  committed fa1ec61

oauthclient "is_oauth_authenticated" return *True* when the user is authenticated. Update using functions accordingly

  • Participants
  • Parent commits b5df77f

Comments (0)

Files changed (1)

File oauthclient/utils.py

     provider identifier.
     
     """
-    return not (identifier + '_oauth_token' and identifier + '_oauth_token_secret' in request.session)
+    return (identifier + '_oauth_token' and identifier + '_oauth_token_secret' in request.session)
     
 def need_oauth_authentication(identifier, force=False):
     """Decorator when oauth authentication is needed.
     def wrapper(func):
         def wrapped(*args, **kwargs):
             request = args[0]
-            if force or is_oauth_authenticated(request=request,
+            if force or not is_oauth_authenticated(request=request,
                     identifier=identifier):
                 return redirect('%s?next=%s' % (
                     reverse('oauth:request_token'),