Permalink
Browse files

views.py: prevent exception on unknown user login

  • Loading branch information...
silum committed Nov 3, 2017
1 parent b83d693 commit 5fc14d6868898d7b6044086638ebe9c2c5ed1b71
Showing with 2 additions and 1 deletion.
  1. +2 −1 docs/quick_tutorial/authorization/tutorial/views.py
@@ -45,7 +45,8 @@ def login(self):
if 'form.submitted' in request.params:
login = request.params['login']
password = request.params['password']
if check_password(password, USERS.get(login)):
hashed_pw = USERS.get(login)
if hashed_pw and check_password(password, hashed_pw):
headers = remember(request, login)
return HTTPFound(location=came_from,
headers=headers)

0 comments on commit 5fc14d6

Please sign in to comment.