user.html: Log off user after he deleted himself

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
This commit is contained in:
Adrian Schmutzler 2018-01-19 14:47:32 +01:00
parent c3c0c54715
commit b43be1bfcc
1 changed files with 2 additions and 0 deletions

View File

@ -340,6 +340,8 @@ def user_info(nickname):
mysql.commit()
flash("<b>User <i>%s</i> deleted!</b>" % nickname, "success")
mysql.close()
if user["nickname"] == session.get("user"):
session.pop('user', None)
return redirect(url_for("user_list"))
else:
flash("<b>You are not authorized to perform this action!</b>", "danger")