aboutsummaryrefslogtreecommitdiffstats
path: root/backend/models/form.py
diff options
context:
space:
mode:
authorGravatar ks129 <[email protected]>2021-03-16 09:29:34 +0200
committerGravatar GitHub <[email protected]>2021-03-16 09:29:34 +0200
commit535ca293b9448006dce2bf92a202ce6679ece86b (patch)
tree940df1727148b6a49f84351c78433324d97eb1db /backend/models/form.py
parentSplit public fields constant to multiple lines (diff)
Split if statement to multiple lines to avoid noqa
Diffstat (limited to 'backend/models/form.py')
-rw-r--r--backend/models/form.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/backend/models/form.py b/backend/models/form.py
index 8780aa7..a6fe888 100644
--- a/backend/models/form.py
+++ b/backend/models/form.py
@@ -70,7 +70,10 @@ class Form(BaseModel):
@root_validator
def validate_role(cls, values: dict[str, t.Any]) -> t.Optional[dict[str, t.Any]]:
"""Validates does Discord role provided when flag provided."""
- if FormFeatures.ASSIGN_ROLE.value in values.get("features", []) and not values.get("discord_role"): # noqa
+ if (
+ FormFeatures.ASSIGN_ROLE.value in values.get("features", [])
+ and not values.get("discord_role"
+ ):
raise ValueError(
"discord_role field is required when ASSIGN_ROLE flag is provided."
)