aboutsummaryrefslogtreecommitdiff
path: root/app/views
diff options
context:
space:
mode:
authorrubenwardy <rw@rubenwardy.com>2018-05-29 18:27:33 +0100
committerrubenwardy <rw@rubenwardy.com>2018-05-29 18:27:39 +0100
commitdf291db69b68838e1f0c45753e210bc5f059bc08 (patch)
treec3afa337c35ea00978e6c3d2b643037882ed7e69 /app/views
parent63a3b5e8727a0a40acd0c81e1d98eddfa4cb6cae (diff)
downloadcheatdb-df291db69b68838e1f0c45753e210bc5f059bc08.tar.xz
Add email/password sign up
Diffstat (limited to 'app/views')
-rw-r--r--app/views/__init__.py12
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()