aboutsummaryrefslogtreecommitdiffstats
path: root/pydis_site/apps/api/models
diff options
context:
space:
mode:
authorGravatar mbaruh <[email protected]>2022-10-08 15:44:37 +0300
committerGravatar mbaruh <[email protected]>2022-10-10 22:33:42 +0300
commitc3747b6d09ff968858eab698eb5fcffb9c3fbd1f (patch)
tree1d7b5a872d113100ff2d26166eb340ed9eb5e6b2 /pydis_site/apps/api/models
parentAllow ping arrays to be empty (diff)
Allow char fields to be blank
This is necessary allow filters to define a blank message when the default is not blank. Additionally allows bypass_roles to be empty like the other array fields
Diffstat (limited to 'pydis_site/apps/api/models')
-rw-r--r--pydis_site/apps/api/models/bot/filters.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/pydis_site/apps/api/models/bot/filters.py b/pydis_site/apps/api/models/bot/filters.py
index 22482870..81b72c6e 100644
--- a/pydis_site/apps/api/models/bot/filters.py
+++ b/pydis_site/apps/api/models/bot/filters.py
@@ -20,12 +20,14 @@ class FilterSettingsMixin(models.Model):
dm_content = models.CharField(
max_length=1000,
null=True,
+ blank=True,
help_text="The DM to send to a user triggering this filter."
)
dm_embed = models.CharField(
max_length=2000,
help_text="The content of the DM embed",
- null=True
+ null=True,
+ blank=True
)
infraction_type = models.CharField(
choices=[(choices[0].upper(), choices[1]) for choices in Infraction.TYPE_CHOICES],
@@ -36,6 +38,7 @@ class FilterSettingsMixin(models.Model):
infraction_reason = models.CharField(
max_length=1000,
help_text="The reason to give for the infraction.",
+ blank=True,
null=True
)
infraction_duration = models.DurationField(