# HG changeset patch # User Mads Kiilerich # Date 2020-03-23 14:29:31 # Node ID 9e4f0baa18e7aa72ada599bf093d08be38099bc8 # Parent 2cb54d157d62825a2e6ca3665f3ffea897ab6fa1 login: clarify comments diff --git a/kallithea/controllers/login.py b/kallithea/controllers/login.py --- a/kallithea/controllers/login.py +++ b/kallithea/controllers/login.py @@ -79,8 +79,8 @@ class LoginController(BaseController): # import Login Form validator class login_form = LoginForm()() try: + # login_form will check username/password using ValidAuth and report failure to the user c.form_result = login_form.to_python(dict(request.POST)) - # form checks for username/password, now we're authenticated username = c.form_result['username'] user = User.get_by_username_or_email(username) assert user is not None # the same user get just passed in the form validation @@ -102,6 +102,7 @@ class LoginController(BaseController): # Exception itself h.flash(e, 'error') else: + # login_form already validated the password - now set the session cookie accordingly auth_user = log_in_user(user, c.form_result['remember'], is_external_auth=False, ip_addr=request.ip_addr) if auth_user: raise HTTPFound(location=c.came_from)