# HG changeset patch # User dellsystem # Date 1350706598 14400 # Node ID c494e6ecff586962c5044942a09a572bd1dd6faa # Parent fba603bfcff834a813296ea9aff645229a58cde6 Fix bug in logging in with incorrect credentials diff -r fba603bfcff8 -r c494e6ecff58 views.py --- a/views.py Mon Oct 15 02:43:30 2012 -0400 +++ b/views.py Sat Oct 20 00:16:38 2012 -0400 @@ -33,9 +33,17 @@ if username and password: user = authenticate(username=username, password=password) - login(request, user) + + if user is not None: + login(request, user) + return redirect(next_url) - return redirect(next_url) + # Could not authenticate + form = { + 'username': { + 'errors': 'Your username and password did not match.', + } + } else: form = { 'password1': {