diff options
author | 2020-12-29 15:45:32 +0200 | |
---|---|---|
committer | 2020-12-29 15:45:32 +0200 | |
commit | d18b21a242f1154f900ac827a01300b99fc77717 (patch) | |
tree | baa2bb9567e96fb7966fcec40e41f97b0802ac60 | |
parent | Add ASSIGN_ROLE flag to schema and to enum (diff) |
Add discord_role field to form and it's schema
-rw-r--r-- | SCHEMA.md | 13 | ||||
-rw-r--r-- | backend/models/form.py | 1 |
2 files changed, 8 insertions, 6 deletions
@@ -14,12 +14,13 @@ In this document: | 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. | +| `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. | +| `discord_role` | String (optional) | Discord role ID what will be assigned, required when `ASSIGN_ROLE` flag provided. | `784467518298259466` | ### Form features diff --git a/backend/models/form.py b/backend/models/form.py index 57372ea..64b198b 100644 --- a/backend/models/form.py +++ b/backend/models/form.py @@ -33,6 +33,7 @@ class Form(BaseModel): name: str description: str webhook: _WebHook = None + discord_role: t.Optional[str] class Config: allow_population_by_field_name = True |