aboutsummaryrefslogtreecommitdiffstats
path: root/pydis_site/apps/api/models
diff options
context:
space:
mode:
authorGravatar MarkKoz <[email protected]>2020-03-21 10:04:44 -0700
committerGravatar MarkKoz <[email protected]>2020-03-21 11:08:12 -0700
commit145beb37fcb4fa2f487f18b234dd72bc4e10c279 (patch)
treec2fe86bae156cfa990c54fdf22b5d8c5b26f9932 /pydis_site/apps/api/models
parentUse basename instead of base_name with DRF router (diff)
Allow empty list for message embeds
By default, blank=False for ArrayFields but allow_empty=True for ListField. Before DRF 3.10 there was a bug that ListField didn't respect the default value of blank=False and thus created a ListField in the serialiser with the default of allow_empty=True. We were relying on the behaviour of that bug. See encode/django-rest-framework#6597.
Diffstat (limited to 'pydis_site/apps/api/models')
-rw-r--r--pydis_site/apps/api/models/bot/message.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/pydis_site/apps/api/models/bot/message.py b/pydis_site/apps/api/models/bot/message.py
index 8b18fc9f..0b279580 100644
--- a/pydis_site/apps/api/models/bot/message.py
+++ b/pydis_site/apps/api/models/bot/message.py
@@ -49,6 +49,7 @@ class Message(ModelReprMixin, models.Model):
pgfields.JSONField(
validators=(validate_tag_embed,)
),
+ blank=True,
help_text="Embeds attached to this message."
)
attachments = pgfields.ArrayField(