Commits

Sergey Maranchuk committed 88110af

fix #40 : not_authenticated decorator should respect LOGIN_REDIRECT_URL

Comments (0)

Files changed (1)

django_authopenid/views.py

         'message': message
     })
 
-
 def not_authenticated(func):
     """ decorator that redirect user to next page if
     he is already logged."""
     def decorated(request, *args, **kwargs):
         if request.user.is_authenticated():
-            next = request.GET.get("next", "/")
+            next = request.GET.get("next", settings.LOGIN_REDIRECT_URL)
             return HttpResponseRedirect(next)
         return func(request, *args, **kwargs)
     return decorated
         'form': form,
         redirect_field_name: redirect_to
     }, context_instance=_build_context(request, extra_context=extra_context))     
-    
+
 @login_required
 def dissociate(request, template_name="authopenid/dissociate.html",
         dissociate_form=OpenidDissociateForm,