~azzar1/unity/add-show-desktop-key

« back to all changes in this revision

Viewing changes to ivle/webapp/security/views.py

Don't crash when not authenticated, and display an error on password absence.

Show diffs side-by-side

added added

removed removed

Lines of Context:
76
76
                        badlogin = msg
77
77
                    if user is None:
78
78
                        # Must have got an error. Do not authenticate.
 
79
                        # The except: above will have set a message.
79
80
                        pass
80
 
                    elif user.password_expired:
81
 
                        badlogin = "Your password has expired."
82
 
                    elif user.account_expired:
83
 
                        badlogin = "Your account has expired."
84
81
                    else:
85
82
                        # Success - Set the session and redirect to the URL.
86
83
                        session = req.get_session()
100
97
 
101
98
                        req.throw_redirect(nexturl)
102
99
 
103
 
                    # We didn't succeed.
104
 
                    # Render the login form with the error message.
105
 
                    ctx['error'] = badlogin
 
100
                # We didn't succeed.
 
101
                # Render the login form with the error message.
 
102
                ctx['error'] = badlogin
106
103
 
107
104
 
108
105
class LogoutView(XHTMLView):