aboutsummaryrefslogtreecommitdiffstats
path: root/backend/models/form.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/models/form.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/models/form.py')
-rw-r--r--backend/models/form.py10
1 files changed, 2 insertions, 8 deletions
diff --git a/backend/models/form.py b/backend/models/form.py
index d5e2ff5..57372ea 100644
--- a/backend/models/form.py
+++ b/backend/models/form.py
@@ -4,7 +4,7 @@ import httpx
from pydantic import BaseModel, Field, validator
from pydantic.error_wrappers import ErrorWrapper, ValidationError
-from backend.constants import FormFeatures, Meta, WebHook
+from backend.constants import FormFeatures, WebHook
from .question import Question
PUBLIC_FIELDS = ["id", "features", "questions", "name", "description"]
@@ -24,11 +24,6 @@ class _WebHook(BaseModel):
return url
-class _FormMeta(BaseModel):
- """Schema model for form meta data."""
- webhook: _WebHook = None
-
-
class Form(BaseModel):
"""Schema model for form."""
@@ -37,7 +32,7 @@ class Form(BaseModel):
questions: list[Question]
name: str
description: str
- meta: _FormMeta = _FormMeta()
+ webhook: _WebHook = None
class Config:
allow_population_by_field_name = True
@@ -124,7 +119,6 @@ async def validate_hook_url(url: str) -> t.Optional[ValidationError]:
await validate()
except Exception as e:
loc = (
- Meta.__name__.lower(),
WebHook.__name__.lower(),
WebHook.URL.value
)