Fix banned users having incorrect rank after account deactivation

This commit is contained in:
rubenwardy 2023-08-13 13:29:55 +01:00
parent f1b2465e82
commit 2454738eaa

@ -269,7 +269,9 @@ def delete(username):
for thread in user.threads.all():
db.session.delete(thread)
user.email = None
user.rank = UserRank.NOT_JOINED
if user.rank != UserRank.BANNED:
user.rank = UserRank.NOT_JOINED
msg = "Deactivated user {}".format(user.username)
flash(msg, "success")