aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristopher Allan Webber <cwebber@dustycloud.org>2011-04-03 18:28:17 -0500
committerChristopher Allan Webber <cwebber@dustycloud.org>2011-04-03 18:28:17 -0500
commitd193896315ea3729759fa92e227c21073f4d4568 (patch)
treee7eae0ef2800e1e222d3a6ae3a64498deaee7818
parentb97232fa2f8f5fbf5c1999c348a3cae66acf4834 (diff)
downloadmediagoblin-d193896315ea3729759fa92e227c21073f4d4568.tar.lz
mediagoblin-d193896315ea3729759fa92e227c21073f4d4568.tar.xz
mediagoblin-d193896315ea3729759fa92e227c21073f4d4568.zip
Also handle when there is no such user
-rw-r--r--mediagoblin/auth/views.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/mediagoblin/auth/views.py b/mediagoblin/auth/views.py
index 71c2d7a9..03c31576 100644
--- a/mediagoblin/auth/views.py
+++ b/mediagoblin/auth/views.py
@@ -79,11 +79,10 @@ def login(request):
login_failed = False
if request.method == 'POST' and login_form.validate():
- #try:
user = request.db.User.find_one(
{'username': request.POST['username']})
- if user.check_login(request.POST['password']):
+ if user and user.check_login(request.POST['password']):
# set up login in session
request.session['user_id'] = unicode(user['_id'])
request.session.save()