From b79638b2dd1f928198bc782b855ae76644aeaf27 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Thu, 11 Aug 2022 06:02:23 +0200 Subject: [PATCH] fix 500 error in /revert_actions --- files/routes/admin.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/files/routes/admin.py b/files/routes/admin.py index b843994163..e83a5556b5 100644 --- a/files/routes/admin.py +++ b/files/routes/admin.py @@ -267,7 +267,8 @@ def revert_actions(v, username): user.unban_utc = 0 user.ban_evade = 0 user.ban_reason = None - send_repeatable_notification(user.id, f"@{v.username} has unbanned you!") + if user.is_banned: + send_repeatable_notification(user.id, f"@{v.username} has unbanned you!") g.db.add(user) for u in user.alts: u.shadowbanned = None @@ -275,7 +276,8 @@ def revert_actions(v, username): u.unban_utc = 0 u.ban_evade = 0 u.ban_reason = None - send_repeatable_notification(u.id, f"@{v.username} has unbanned you!") + if u.is_banned: + send_repeatable_notification(u.id, f"@{v.username} has unbanned you!") g.db.add(u) return {"message": "Admin actions reverted!"}