aboutsummaryrefslogtreecommitdiffstats
path: root/backend/routes/forms/submit.py
diff options
context:
space:
mode:
authorGravatar Hassan Abouelela <[email protected]>2020-12-22 04:25:25 +0300
committerGravatar Hassan Abouelela <[email protected]>2020-12-22 04:57:10 +0300
commit1c0684faa1f1a8d36fe57294fcb6e180c622c259 (patch)
tree380167bdd4602c58445d36dea8739a3e255e2489 /backend/routes/forms/submit.py
parentMerge pull request #42 from python-discord/big-int-fix (diff)
Dedents Webhook Object
Removes the meta object, and moves the webhook object under the main form object to reduce nesting. Signed-off-by: Hassan Abouelela <[email protected]>
Diffstat (limited to 'backend/routes/forms/submit.py')
-rw-r--r--backend/routes/forms/submit.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/backend/routes/forms/submit.py b/backend/routes/forms/submit.py
index 82caa81..8588a2d 100644
--- a/backend/routes/forms/submit.py
+++ b/backend/routes/forms/submit.py
@@ -155,7 +155,7 @@ class SubmitForm(Route):
) -> None:
"""Helper to send a submission message to a discord webhook."""
# Stop if webhook is not available
- if form.meta.webhook is None:
+ if form.webhook is None:
raise ValueError("Got empty webhook.")
try:
@@ -190,7 +190,7 @@ class SubmitForm(Route):
}
# Set hook message
- message = form.meta.webhook.message
+ message = form.webhook.message
if message:
# Available variables, see SCHEMA.md
ctx = {
@@ -208,5 +208,5 @@ class SubmitForm(Route):
# Post hook
async with httpx.AsyncClient() as client:
- r = await client.post(form.meta.webhook.url, json=hook)
+ r = await client.post(form.webhook.url, json=hook)
r.raise_for_status()