From d8fa3342cf4875a73ef1e07fdb5beb575edbdcc9 Mon Sep 17 00:00:00 2001 From: rubenwardy Date: Sun, 14 May 2023 17:23:30 +0100 Subject: [PATCH] Discord webhooks: Fix understood failing status codes --- app/tasks/webhooktasks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/tasks/webhooktasks.py b/app/tasks/webhooktasks.py index 9fdba334..03b262a3 100644 --- a/app/tasks/webhooktasks.py +++ b/app/tasks/webhooktasks.py @@ -52,6 +52,6 @@ def post_discord_webhook(username: Optional[str], content: str, is_queue: bool, json["embeds"] = [embed] res = requests.post(discord_url, json=json, headers={"Accept": "application/json"}) - if res.status_code != 200: + if not res.ok: raise Exception(f"Failed to submit Discord webhook {res.json}") res.raise_for_status()