diff options
| author | rubenwardy <rw@rubenwardy.com> | 2018-05-29 18:27:33 +0100 |
|---|---|---|
| committer | rubenwardy <rw@rubenwardy.com> | 2018-05-29 18:27:39 +0100 |
| commit | df291db69b68838e1f0c45753e210bc5f059bc08 (patch) | |
| tree | c3afa337c35ea00978e6c3d2b643037882ed7e69 /app/views | |
| parent | 63a3b5e8727a0a40acd0c81e1d98eddfa4cb6cae (diff) | |
| download | cheatdb-df291db69b68838e1f0c45753e210bc5f059bc08.tar.xz | |
Add email/password sign up
Diffstat (limited to 'app/views')
| -rw-r--r-- | app/views/__init__.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/app/views/__init__.py b/app/views/__init__.py index 21ed40d..09c7be8 100644 --- a/app/views/__init__.py +++ b/app/views/__init__.py @@ -62,7 +62,11 @@ def flatpage(path): @app.before_request def do_something_whenever_a_request_comes_in(): - if current_user.is_authenticated and current_user.rank == UserRank.BANNED: - flash("You have been banned.", "error") - logout_user() - return redirect(url_for('user.login')) + if current_user.is_authenticated: + if current_user.rank == UserRank.BANNED: + flash("You have been banned.", "error") + logout_user() + return redirect(url_for('user.login')) + elif current_user.rank == UserRank.NOT_JOINED: + current_user.rank = UserRank.MEMBER + db.session.commit() |
