From d18b21a242f1154f900ac827a01300b99fc77717 Mon Sep 17 00:00:00 2001 From: ks129 <45097959+ks129@users.noreply.github.com> Date: Tue, 29 Dec 2020 15:45:32 +0200 Subject: Add discord_role field to form and it's schema --- SCHEMA.md | 13 +++++++------ backend/models/form.py | 1 + 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/SCHEMA.md b/SCHEMA.md index 11b4b89..a1e9698 100644 --- a/SCHEMA.md +++ b/SCHEMA.md @@ -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 -- cgit v1.2.3