aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar ks129 <[email protected]>2021-01-20 19:47:46 +0200
committerGravatar GitHub <[email protected]>2021-01-20 19:47:46 +0200
commit9fadda8e51f5bf5593f07e66abdde34d940e122c (patch)
treeec9f9cd8f28f7a01380bbcd8bbb71f85ca7efe7a
parentMerge pull request #53 from python-discord/dependabot/pip/pyjwt-2.0.1 (diff)
parentAdd an optional submitted_text field to forms to customize the response upon ... (diff)
Merge pull request #54 from MrGrote/feature/response
Add an optional response field to forms.
-rw-r--r--SCHEMA.md17
-rw-r--r--backend/models/form.py3
2 files changed, 11 insertions, 9 deletions
diff --git a/SCHEMA.md b/SCHEMA.md
index fe02fc8..6aae7d6 100644
--- a/SCHEMA.md
+++ b/SCHEMA.md
@@ -12,14 +12,15 @@ In this document:
## Form
-| Field | Type | Description | Example |
-| ------------- | ----------------------------------------- | ----------------------------------------------------------------------------------------- | ---------------------------------------- |
-| `id` | Unique identifier | A user selected, unique, descriptive identifier (used in URL routes, so no spaces) | `"ban-appeals"` |
-| `features` | List of [form features](#form-features) | A list of features to change the behaviour of the form, described in the features section | `["OPEN", "COLLECT_EMAIL"]` |
-| `questions` | List of [form questions](#form-question) | The list of questions to render on a specific form | Too long! See below |
-| `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. |
+| Field | Type | Description | Example |
+| ------------------- | ----------------------------------------- | ----------------------------------------------------------------------------------------- | ---------------------------------------- |
+| `id` | Unique identifier | A user selected, unique, descriptive identifier (used in URL routes, so no spaces) | `"ban-appeals"` |
+| `features` | List of [form features](#form-features) | A list of features to change the behaviour of the form, described in the features section | `["OPEN", "COLLECT_EMAIL"]` |
+| `questions` | List of [form questions](#form-question) | The list of questions to render on a specific form | Too long! See below |
+| `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. |
+| `submitted_text` | 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..8e59905 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", "submitted_text"]
class _WebHook(BaseModel):
@@ -32,6 +32,7 @@ class Form(BaseModel):
questions: list[Question]
name: str
description: str
+ submitted_text: t.Optional[str] = None
webhook: _WebHook = None
class Config: