aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Jannes Jonkers <[email protected]>2021-01-20 18:11:28 +0100
committerGravatar Jannes Jonkers <[email protected]>2021-01-20 18:11:28 +0100
commitb76505a9e28cbadf1590b80694ada496d448a591 (patch)
tree924f9ee837446e4b4116857962abe2b237e1d266
parentMerge pull request #53 from python-discord/dependabot/pip/pyjwt-2.0.1 (diff)
Add an optional response field to forms to customize the response upon submitting.
-rw-r--r--SCHEMA.md1
-rw-r--r--backend/models/form.py3
2 files changed, 3 insertions, 1 deletions
diff --git a/SCHEMA.md b/SCHEMA.md
index fe02fc8..4a15f28 100644
--- a/SCHEMA.md
+++ b/SCHEMA.md
@@ -20,6 +20,7 @@ In this document:
| `name` | String | Name of the form | `"Summer Code Jam 2100"` |
| `description` | String | Form description | `"This is my amazing form description."` |
| `webhook` | [Webhook object](#webhooks) | An optional discord webhook. | See webhook documentation. |
+| `response` | Optional[String] | An optional string for the response upon submitting. | `"This is my amazing form response."` |
### Form features
diff --git a/backend/models/form.py b/backend/models/form.py
index 57372ea..bc29cfa 100644
--- a/backend/models/form.py
+++ b/backend/models/form.py
@@ -7,7 +7,7 @@ from pydantic.error_wrappers import ErrorWrapper, ValidationError
from backend.constants import FormFeatures, WebHook
from .question import Question
-PUBLIC_FIELDS = ["id", "features", "questions", "name", "description"]
+PUBLIC_FIELDS = ["id", "features", "questions", "name", "description", "response"]
class _WebHook(BaseModel):
@@ -32,6 +32,7 @@ class Form(BaseModel):
questions: list[Question]
name: str
description: str
+ response: t.Optional[str] = None
webhook: _WebHook = None
class Config: