diff options
| author | 2021-01-20 18:31:27 +0100 | |
|---|---|---|
| committer | 2021-01-20 18:31:27 +0100 | |
| commit | 31f4f3ce70f5fdefc044cf561c491adbabfb1d67 (patch) | |
| tree | ec9f9cd8f28f7a01380bbcd8bbb71f85ca7efe7a | |
| parent | Add an optional response field to forms to customize the response upon submit... (diff) | |
Add an optional submitted_text field to forms to customize the response upon submitting.
Diffstat (limited to '')
| -rw-r--r-- | SCHEMA.md | 18 | ||||
| -rw-r--r-- | backend/models/form.py | 4 | 
2 files changed, 11 insertions, 11 deletions
| @@ -12,15 +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.               | -| `response`    | Optional[String]                          | An optional string for the response upon submitting.                                      | `"This is my amazing form response."`    | +| 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 bc29cfa..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", "response"] +PUBLIC_FIELDS = ["id", "features", "questions", "name", "description", "submitted_text"]  class _WebHook(BaseModel): @@ -32,7 +32,7 @@ class Form(BaseModel):      questions: list[Question]      name: str      description: str -    response: t.Optional[str] = None +    submitted_text: t.Optional[str] = None      webhook: _WebHook = None      class Config: | 
