forked from rDrama/rDrama
fix ban_reason getting wiped accidentially
parent
e50bbe0da0
commit
cc7176868d
|
@ -1157,7 +1157,8 @@ def unban_user(id, v):
|
||||||
|
|
||||||
user.is_banned = None
|
user.is_banned = None
|
||||||
user.unban_utc = 0
|
user.unban_utc = 0
|
||||||
user.ban_reason = None
|
if not user.shadowbanned:
|
||||||
|
user.ban_reason = None
|
||||||
send_repeatable_notification(user.id, f"@{v.username} (a site admin) has unbanned you!")
|
send_repeatable_notification(user.id, f"@{v.username} (a site admin) has unbanned you!")
|
||||||
g.db.add(user)
|
g.db.add(user)
|
||||||
|
|
||||||
|
@ -1165,7 +1166,8 @@ def unban_user(id, v):
|
||||||
if x.is_banned: send_repeatable_notification(x.id, f"@{v.username} (a site admin) has unbanned you!")
|
if x.is_banned: send_repeatable_notification(x.id, f"@{v.username} (a site admin) has unbanned you!")
|
||||||
x.is_banned = None
|
x.is_banned = None
|
||||||
x.unban_utc = 0
|
x.unban_utc = 0
|
||||||
x.ban_reason = None
|
if not x.shadowbanned:
|
||||||
|
x.ban_reason = None
|
||||||
g.db.add(x)
|
g.db.add(x)
|
||||||
|
|
||||||
ma=ModAction(
|
ma=ModAction(
|
||||||
|
|
|
@ -269,7 +269,8 @@ def award_thing(v, thing_type, id):
|
||||||
else:
|
else:
|
||||||
author.unban_utc = 0
|
author.unban_utc = 0
|
||||||
author.is_banned = None
|
author.is_banned = None
|
||||||
author.ban_reason = None
|
if not author.shadowbanned:
|
||||||
|
author.ban_reason = None
|
||||||
send_repeatable_notification(author.id, "You have been unbanned!")
|
send_repeatable_notification(author.id, "You have been unbanned!")
|
||||||
elif kind == "grass":
|
elif kind == "grass":
|
||||||
link3 = f"/{thing_type}/{thing.id}"
|
link3 = f"/{thing_type}/{thing.id}"
|
||||||
|
@ -568,4 +569,4 @@ def get_number_tuple(input, mods):
|
||||||
result, input = shift_number_down(input, mod)
|
result, input = shift_number_down(input, mod)
|
||||||
results.append(result)
|
results.append(result)
|
||||||
results.append(input)
|
results.append(input)
|
||||||
return results
|
return results
|
||||||
|
|
Loading…
Reference in New Issue