fix: prevents user with active session to register
This commit is contained in:
@@ -32,6 +32,8 @@ def logout():
|
|||||||
|
|
||||||
@bp.route('/register', methods=["GET", "POST"])
|
@bp.route('/register', methods=["GET", "POST"])
|
||||||
def register():
|
def register():
|
||||||
|
if session.get('id') is not None:
|
||||||
|
return redirect("/users/")
|
||||||
if request.method == 'POST':
|
if request.method == 'POST':
|
||||||
if UserService.register_user(request.form):
|
if UserService.register_user(request.form):
|
||||||
return redirect("/users/")
|
return redirect("/users/")
|
||||||
|
|||||||
Reference in New Issue
Block a user