silum
2017-11-03 73d5e6b3339e99de822fae204dd2821c2735c4d9
views.py: prevent exception on unknown user login

(cherry picked from commit 5fc14d6)
1 files modified
3 ■■■■ changed files
docs/quick_tutorial/authorization/tutorial/views.py 3 ●●●● patch | view | raw | blame | history
docs/quick_tutorial/authorization/tutorial/views.py
@@ -45,7 +45,8 @@
        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)