diff options
author | 2021-01-20 19:47:46 +0200 | |
---|---|---|
committer | 2021-01-20 19:47:46 +0200 | |
commit | 9fadda8e51f5bf5593f07e66abdde34d940e122c (patch) | |
tree | ec9f9cd8f28f7a01380bbcd8bbb71f85ca7efe7a | |
parent | Merge pull request #53 from python-discord/dependabot/pip/pyjwt-2.0.1 (diff) | |
parent | Add 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.md | 17 | ||||
-rw-r--r-- | backend/models/form.py | 3 |
2 files changed, 11 insertions, 9 deletions
@@ -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: |