Source

django-publicauth / publicauth / backends / __init__.py

Diff from to

File publicauth/backends/__init__.py

         Do nothing in case of failure.
         """
         # only actavted users can login if activation required.
-        if settings.PUBLICAUTH_ACTIVATION_REQUIRED and not request.user.is_active:
+        user = auth.authenticate(identity=self.identity, provider=self.provider)
+        if user and settings.PUBLICAUTH_ACTIVATION_REQUIRED and not request.user.is_active:
             messages.add_message(request, messages.ERROR, lang.NOT_ACTIVATED)
             raise Redirect(global_settings.LOGIN_REDIRECT_URL)
 
         # authenticate and redirect user.
-        user = auth.authenticate(identity=self.identity, provider=self.provider)
         if user:
             messages.add_message(request, messages.SUCCESS, lang.SUCCESSFULLY_AUTHENTICATED)
             auth.login(request, user)