From 267bd76b0e388c35699985b5938fd69b45fd7a82 Mon Sep 17 00:00:00 2001 From: Aevann Date: Thu, 12 Oct 2023 16:39:17 +0300 Subject: [PATCH] fix 500 error --- files/routes/awards.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/files/routes/awards.py b/files/routes/awards.py index 7390e61e0..adad0a4c7 100644 --- a/files/routes/awards.py +++ b/files/routes/awards.py @@ -601,9 +601,12 @@ def award_thing(v, thing_type, id): if v.id != author.id: if author.deflector and AWARDS[kind]['deflectable']: msg = f"@{v.username} has tried to give your [{thing_type}]({thing.shortlink}) the {award_title} Award but it was deflected and applied to them :marseytroll:" - send_repeatable_notification(author.id, msg).created_utc -= 1 + n = send_repeatable_notification(author.id, msg) + if n: n.created_utc -= 1 + msg = f"{safe_username} under the effect of a deflector award; your {award_title} Award has been deflected back to you :marseytroll:" - send_repeatable_notification(v.id, msg).created_utc -= 1 + n = send_repeatable_notification(v.id, msg) + if n: n.created_utc -= 1 elif kind not in {'spider', 'jumpscare'}: msg = f"@{v.username} has given [{link_text_in_notif}]({thing.shortlink}) the {award_title} Award" @@ -620,8 +623,8 @@ def award_thing(v, thing_type, id): if kind == "chud": msg += f"\n\n**You now have to say this phrase in all posts and comments you make for 24 hours:**" msg += f"\n\n> {note}" - send_repeatable_notification(author.id, msg).created_utc -= 1 - + n = send_repeatable_notification(author.id, msg) + if n: n.created_utc -= 1 if author.received_award_count: author.received_award_count += 1 else: author.received_award_count = 1