1. Flavio Percoco
  2. django-authopenid

Commits

Flavio Percoco  committed 1a6440b

Fixed stupid error :)

  • Participants
  • Parent commits fe9a803
  • Branches trunk

Comments (0)

Files changed (1)

File django_authopenid/decorators.py

View file
  • Ignore whitespace
 def login_required(f):
         def wrap(request, *args, **kwargs):
                 #this check the session if userid key exist, if not it will redirect to login page
-                if 'userid' not in request.session.keys():
+                if not request.user.is_authenticated():
                         return HttpResponseRedirect("/accounts/signin/")
                 return f(request, *args, **kwargs)
         wrap.__doc__=f.__doc__