From 087693789f119dfa552d6966334330041213251b Mon Sep 17 00:00:00 2001 From: elvis kahoro Date: Sat, 28 Sep 2024 18:25:21 -0700 Subject: [PATCH] fix: no longer setting the discord webhoook url as global variable --- pcweb/templates/docpage/state.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pcweb/templates/docpage/state.py b/pcweb/templates/docpage/state.py index 1480798b19..be525ecc2d 100644 --- a/pcweb/templates/docpage/state.py +++ b/pcweb/templates/docpage/state.py @@ -41,7 +41,7 @@ def handle_submit(self, form_data: dict): json=form_data, ) - DISCORD_WEBHOOK_URL = os.environ.get("DISCORD_WEBHOOK_URL") + discord_webhook_url: str | None = os.environ.get("DISCORD_WEBHOOK_URL") email: str = form_data.get("email", "") discord_message = f""" Contact: {email} @@ -53,7 +53,7 @@ def handle_submit(self, form_data: dict): try: with httpx.Client() as client: response: Response = client.post( - DISCORD_WEBHOOK_URL, + discord_webhook_url, json=payload, ) response.raise_for_status()