From 777c9a22bfc3fdd535919d32492893d24ae3358f Mon Sep 17 00:00:00 2001 From: Aevann Date: Tue, 16 Apr 2024 19:44:38 +0200 Subject: [PATCH] fix 500 error --- files/routes/awards.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/routes/awards.py b/files/routes/awards.py index 077f76eb4..b37853279 100644 --- a/files/routes/awards.py +++ b/files/routes/awards.py @@ -339,7 +339,7 @@ def award_thing(v, thing_type, id): send_repeatable_notification(author.id, "You have been unbanned!") elif kind == "grass": new_unban_utc = int(time.time()) + 30 * 86400 - if author.unban_utc > new_unban_utc: + if author.is_banned and (not author.unban_utc or author.unban_utc > new_unban_utc): abort(403, f"{safe_username} already banned for more than 30 days!") author.is_banned = AUTOJANNY_ID author.unban_utc = new_unban_utc