summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJayaram Pai2013-12-15 12:20:00 +0530
committerJayaram Pai2013-12-15 12:20:00 +0530
commit58181ccc5be1da52bc4d73e793fb530a861eed28 (patch)
tree8b86ded217390c95daabee4f12d8564fb2822a52
parent0e47eb3805386e3c95ddb2ee71d4440f57a5b8e7 (diff)
downloadPython-TBC-Interface-58181ccc5be1da52bc4d73e793fb530a861eed28.tar.gz
Python-TBC-Interface-58181ccc5be1da52bc4d73e793fb530a861eed28.tar.bz2
Python-TBC-Interface-58181ccc5be1da52bc4d73e793fb530a861eed28.zip
user-login None check
-rw-r--r--tbc/views.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/tbc/views.py b/tbc/views.py
index 0a5dbf5..a8aded8 100644
--- a/tbc/views.py
+++ b/tbc/views.py
@@ -73,7 +73,10 @@ def UserLogin(request):
username = request.POST['username']
password = request.POST['password']
curr_user = authenticate(username=username, password=password)
- login(request, curr_user)
+ if curr_user is not None:
+ login(request, curr_user)
+ else:
+ return HttpResponseRedirect('/login')
if curr_user.groups.filter(name='reviewer').count() == 1:
context['reviewer'] = curr_user
return HttpResponseRedirect("/book-review")