diff options
| author | 2020-12-17 12:20:38 +0300 | |
|---|---|---|
| committer | 2020-12-17 12:20:38 +0300 | |
| commit | 20c72c4d7fe41632d04c619c4510364ba2674599 (patch) | |
| tree | 0d7c32a73bd6a6ef20b1cf7c043278134b16dcf1 | |
| parent | Adds Frontend URL to Env (diff) | |
Makes Webhooks Optional
Fixes a bug that would force you to do a dummy webhook object when
creating a form. Fixes a bug that would force you to add an empty
message for webhooks.
Signed-off-by: Hassan Abouelela <[email protected]>
| -rw-r--r-- | backend/models/form.py | 4 | 
1 files changed, 2 insertions, 2 deletions
| diff --git a/backend/models/form.py b/backend/models/form.py index e6c56a4..ef81616 100644 --- a/backend/models/form.py +++ b/backend/models/form.py @@ -12,7 +12,7 @@ PUBLIC_FIELDS = ["id", "features", "questions", "name", "description"]  class _WebHook(BaseModel):      """Schema model of discord webhooks."""      url: str -    message: str +    message: t.Optional[str]      @validator("url")      def validate_url(cls, url: str) -> str: @@ -55,7 +55,7 @@ class _WebHook(BaseModel):  class _FormMeta(BaseModel):      """Schema model for form meta data.""" -    webhook: _WebHook +    webhook: _WebHook = None  class Form(BaseModel): | 
