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. --- .../0050_remove_infractions_active_default_value.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 pydis_site/apps/api/migrations/0050_remove_infractions_active_default_value.py (limited to 'pydis_site/apps/api/migrations') 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.'), + ), + ] -- cgit v1.2.3 From 05c58d8733fb4a3abb1b023a28bacc9f13195cee Mon Sep 17 00:00:00 2001 From: MarkKoz Date: Sat, 8 Feb 2020 11:01:00 -0800 Subject: Fix migration dependency --- .../api/migrations/0050_remove_infractions_active_default_value.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pydis_site/apps/api/migrations') 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 index a0f03ad4..90c91d63 100644 --- 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 @@ -1,4 +1,4 @@ -# Generated by Django 2.2.6 on 2019-12-19 21:17 +# Generated by Django 2.2.6 on 2020-02-08 19:00 from django.db import migrations, models @@ -6,7 +6,7 @@ from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ - ('api', '0049_offensivemessage'), + ('api', '0049_deletedmessage_attachments'), ] operations = [ -- cgit v1.2.3