aboutsummaryrefslogtreecommitdiffstats
path: root/backend/routes/forms/index.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/index.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/index.py')
-rw-r--r--backend/routes/forms/index.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/backend/routes/forms/index.py b/backend/routes/forms/index.py
index 0e1dee8..5fd90ab 100644
--- a/backend/routes/forms/index.py
+++ b/backend/routes/forms/index.py
@@ -6,7 +6,7 @@ from starlette.authentication import requires
from starlette.requests import Request
from starlette.responses import JSONResponse
-from backend.constants import Meta, WebHook
+from backend.constants import WebHook
from backend.models import Form, FormList
from backend.models.form import validate_hook_url
from backend.route import Route
@@ -51,8 +51,7 @@ class FormsList(Route):
# Verify Webhook
try:
# Get url from request
- path = (Meta.__name__.lower(), WebHook.__name__.lower(), WebHook.URL.value)
- url = form_data[path[0]][path[1]][path[2]]
+ url = form_data[WebHook.__name__.lower()][WebHook.URL.value]
# Validate URL
validation = await validate_hook_url(url)