forked from MarseyWorld/MarseyWorld
fix revert_actions
parent
33018c164b
commit
539188ed85
|
@ -236,7 +236,7 @@ def distribute(v, comment):
|
||||||
def revert_actions(v, username):
|
def revert_actions(v, username):
|
||||||
user = get_user(username)
|
user = get_user(username)
|
||||||
if not user: abort(404)
|
if not user: abort(404)
|
||||||
|
|
||||||
ma = ModAction(
|
ma = ModAction(
|
||||||
kind="revert",
|
kind="revert",
|
||||||
user_id=v.id,
|
user_id=v.id,
|
||||||
|
@ -263,20 +263,21 @@ def revert_actions(v, username):
|
||||||
|
|
||||||
for user in users:
|
for user in users:
|
||||||
user.shadowbanned = None
|
user.shadowbanned = None
|
||||||
user.is_banned = 0
|
|
||||||
user.unban_utc = 0
|
user.unban_utc = 0
|
||||||
user.ban_evade = 0
|
user.ban_evade = 0
|
||||||
user.ban_reason = None
|
user.ban_reason = None
|
||||||
if user.is_banned:
|
if user.is_banned:
|
||||||
|
user.is_banned = 0
|
||||||
send_repeatable_notification(user.id, f"@{v.username} has unbanned you!")
|
send_repeatable_notification(user.id, f"@{v.username} has unbanned you!")
|
||||||
g.db.add(user)
|
g.db.add(user)
|
||||||
|
|
||||||
for u in user.alts:
|
for u in user.alts:
|
||||||
u.shadowbanned = None
|
u.shadowbanned = None
|
||||||
u.is_banned = 0
|
|
||||||
u.unban_utc = 0
|
u.unban_utc = 0
|
||||||
u.ban_evade = 0
|
u.ban_evade = 0
|
||||||
u.ban_reason = None
|
u.ban_reason = None
|
||||||
if u.is_banned:
|
if u.is_banned:
|
||||||
|
u.is_banned = 0
|
||||||
send_repeatable_notification(u.id, f"@{v.username} has unbanned you!")
|
send_repeatable_notification(u.id, f"@{v.username} has unbanned you!")
|
||||||
g.db.add(u)
|
g.db.add(u)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue