forked from rDrama/rDrama
1
0
Fork 0

fix ban_reason getting wiped accidentially

master
Aevann 2023-06-22 14:24:03 +03:00
parent e50bbe0da0
commit cc7176868d
2 changed files with 7 additions and 4 deletions

View File

@ -1157,6 +1157,7 @@ def unban_user(id, v):
user.is_banned = None
user.unban_utc = 0
if not user.shadowbanned:
user.ban_reason = None
send_repeatable_notification(user.id, f"@{v.username} (a site admin) has unbanned you!")
g.db.add(user)
@ -1165,6 +1166,7 @@ def unban_user(id, v):
if x.is_banned: send_repeatable_notification(x.id, f"@{v.username} (a site admin) has unbanned you!")
x.is_banned = None
x.unban_utc = 0
if not x.shadowbanned:
x.ban_reason = None
g.db.add(x)

View File

@ -269,6 +269,7 @@ def award_thing(v, thing_type, id):
else:
author.unban_utc = 0
author.is_banned = None
if not author.shadowbanned:
author.ban_reason = None
send_repeatable_notification(author.id, "You have been unbanned!")
elif kind == "grass":