aboutsummaryrefslogtreecommitdiff
path: root/app/views
diff options
context:
space:
mode:
Diffstat (limited to 'app/views')
-rw-r--r--app/views/__init__.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/app/views/__init__.py b/app/views/__init__.py
index abaacd7..8bfb178 100644
--- a/app/views/__init__.py
+++ b/app/views/__init__.py
@@ -51,3 +51,10 @@ def flatpage(path):
page = pages.get_or_404(path)
template = page.meta.get('template', 'flatpage.html')
return render_template(template, page=page)
+
+@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'))