diff options
-rw-r--r-- | backend/routes/forms/index.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/backend/routes/forms/index.py b/backend/routes/forms/index.py index 5fd90ab..22171fa 100644 --- a/backend/routes/forms/index.py +++ b/backend/routes/forms/index.py @@ -51,12 +51,14 @@ class FormsList(Route): # Verify Webhook try: # Get url from request - url = form_data[WebHook.__name__.lower()][WebHook.URL.value] + webhook = form_data[WebHook.__name__.lower()] + if webhook is not None: + url = webhook[WebHook.URL.value] - # Validate URL - validation = await validate_hook_url(url) - if validation: - return JSONResponse(validation.errors(), status_code=422) + # Validate URL + validation = await validate_hook_url(url) + if validation: + return JSONResponse(validation.errors(), status_code=422) except KeyError: pass |