diff options
author | 2019-12-19 13:36:08 -0800 | |
---|---|---|
committer | 2019-12-19 13:36:08 -0800 | |
commit | 438e947d7edaf1f9dfa10bea0a2adf20e0ebbc9f (patch) | |
tree | 5a5e5cfb38044ea8e2716dd654bad38af2415419 /pydis_site/apps/api/migrations | |
parent | Output errors more clearly for infraction serializer test failures (diff) |
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.
Diffstat (limited to 'pydis_site/apps/api/migrations')
-rw-r--r-- | pydis_site/apps/api/migrations/0050_remove_infractions_active_default_value.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/pydis_site/apps/api/migrations/0050_remove_infractions_active_default_value.py b/pydis_site/apps/api/migrations/0050_remove_infractions_active_default_value.py new file mode 100644 index 00000000..a0f03ad4 --- /dev/null +++ b/pydis_site/apps/api/migrations/0050_remove_infractions_active_default_value.py @@ -0,0 +1,18 @@ +# Generated by Django 2.2.6 on 2019-12-19 21:17 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('api', '0049_offensivemessage'), + ] + + operations = [ + migrations.AlterField( + model_name='infraction', + name='active', + field=models.BooleanField(help_text='Whether the infraction is still active.'), + ), + ] |