Add email/password sign up

This commit is contained in:
rubenwardy
2018-05-29 18:27:33 +01:00
parent 63a3b5e872
commit df291db69b
4 changed files with 29 additions and 6 deletions

View File

@@ -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()