aboutsummaryrefslogtreecommitdiff
path: root/app/views
diff options
context:
space:
mode:
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()