From 438e947d7edaf1f9dfa10bea0a2adf20e0ebbc9f Mon Sep 17 00:00:00 2001 From: MarkKoz Date: Thu, 19 Dec 2019 13:36:08 -0800 Subject: Remove default value from the active field of infractions Due to the active field being specified in the UniqueTogetherValidator, the field is implicitly required. Typically default values are excluded from this restriction but in this case some infraction types must always be False. It's easier and makes more sense to require the active field explicitly rather than to write logic in the serializer which is conditional on the type of infractions. --- pydis_site/apps/api/models/bot/infraction.py | 1 - 1 file changed, 1 deletion(-) (limited to 'pydis_site/apps/api/models') diff --git a/pydis_site/apps/api/models/bot/infraction.py b/pydis_site/apps/api/models/bot/infraction.py index 108fd3a2..f58e89a3 100644 --- a/pydis_site/apps/api/models/bot/infraction.py +++ b/pydis_site/apps/api/models/bot/infraction.py @@ -29,7 +29,6 @@ class Infraction(ModelReprMixin, models.Model): ) ) active = models.BooleanField( - default=True, help_text="Whether the infraction is still active." ) user = models.ForeignKey( -- cgit v1.2.3