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

« back to all changes in this revision

Viewing changes to ivle/auth/authenticate.py

Disallow login only when the user is disabled or expired, not just invalid.
Otherwise new users can't log in to accept the ToS.

Show diffs side-by-side

added added

removed removed

Lines of Context:
93
93
                store.add(auth_result)
94
94
 
95
95
            # Don't allow login if it is expired or disabled.
96
 
            if not auth_result.valid:
 
96
            if auth_result.state == 'disabled' or auth_result.account_expired:
97
97
                raise AuthError("Account is not valid.")
98
98
 
99
99
            return auth_result