From 7ee0488a86161840bf064c66406c0eba6148916b Mon Sep 17 00:00:00 2001 From: Aevann Date: Wed, 4 Oct 2023 19:51:57 +0300 Subject: [PATCH] disallow ppl from using unban awards to undo janny bans --- files/routes/awards.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/files/routes/awards.py b/files/routes/awards.py index 92a24d0fc9..93b606847a 100644 --- a/files/routes/awards.py +++ b/files/routes/awards.py @@ -275,6 +275,9 @@ def award_thing(v, thing_type, id): if not author.is_suspended or not author.unban_utc: abort(403) + if not author.ban_reason.startswith('1-Day ban award'): + abort(400, "You can only use unban awards to undo the effect of ban awards!") + if author.unban_utc - time.time() > 86400: author.unban_utc -= 86400 send_repeatable_notification(author.id, "Your ban duration has been reduced by 1 day!")