aboutsummaryrefslogtreecommitdiffstats
path: root/pydis_site/apps/api/migrations
diff options
context:
space:
mode:
authorGravatar mbaruh <[email protected]>2022-11-04 00:30:04 +0200
committerGravatar mbaruh <[email protected]>2022-11-04 00:30:04 +0200
commitfee81cf1f4205024d663fc8055f04ed22bec9f32 (patch)
treee6c81a0129946c8d283e961a033888ac3b64eefa /pydis_site/apps/api/migrations
parentAdd antispam list in migrations (diff)
Stop using None as a valid setting value
See e100ae9b on bot
Diffstat (limited to 'pydis_site/apps/api/migrations')
-rw-r--r--pydis_site/apps/api/migrations/0085_new_filter_schema.py18
-rw-r--r--pydis_site/apps/api/migrations/0086_unique_constraint_filters.py6
-rw-r--r--pydis_site/apps/api/migrations/0087_unique_filter_list.py4
-rw-r--r--pydis_site/apps/api/migrations/0088_antispam_filter_list.py4
4 files changed, 16 insertions, 16 deletions
diff --git a/pydis_site/apps/api/migrations/0085_new_filter_schema.py b/pydis_site/apps/api/migrations/0085_new_filter_schema.py
index a38194ef..b0665ba5 100644
--- a/pydis_site/apps/api/migrations/0085_new_filter_schema.py
+++ b/pydis_site/apps/api/migrations/0085_new_filter_schema.py
@@ -46,10 +46,10 @@ def forward(apps: Apps, schema_editor: BaseDatabaseSchemaEditor) -> None:
enabled=True,
dm_content=dm_content,
dm_embed="" if name != "FILE_FORMAT" else "*Defined at runtime.*",
- infraction_type="",
+ infraction_type="NONE",
infraction_reason="",
infraction_duration=timedelta(seconds=0),
- infraction_channel=None,
+ infraction_channel=0,
disabled_channels=[],
disabled_categories=(["CODE JAM"] if name in ("FILE_FORMAT", "GUILD_INVITE") else []),
enabled_channels=[],
@@ -110,7 +110,7 @@ class Migration(migrations.Migration):
('enabled', models.BooleanField(help_text='Whether this filter is currently enabled.', null=True)),
('dm_content', models.CharField(help_text='The DM to send to a user triggering this filter.', max_length=1000, null=True, blank=True)),
('dm_embed', models.CharField(help_text='The content of the DM embed', max_length=2000, null=True, blank=True)),
- ('infraction_type', models.CharField(choices=[('NOTE', 'Note'), ('WARNING', 'Warning'), ('WATCH', 'Watch'), ('MUTE', 'Mute'), ('KICK', 'Kick'), ('BAN', 'Ban'), ('SUPERSTAR', 'Superstar'), ('VOICE_BAN', 'Voice Ban'), ('VOICE_MUTE', 'Voice Mute')], help_text='The infraction to apply to this user.', max_length=10, null=True)),
+ ('infraction_type', models.CharField(choices=[('NONE', 'None'), ('NOTE', 'Note'), ('WARNING', 'Warning'), ('WATCH', 'Watch'), ('MUTE', 'Mute'), ('KICK', 'Kick'), ('BAN', 'Ban'), ('SUPERSTAR', 'Superstar'), ('VOICE_BAN', 'Voice Ban'), ('VOICE_MUTE', 'Voice Mute')], help_text='The infraction to apply to this user.', max_length=10, null=True)),
('infraction_reason', models.CharField(help_text='The reason to give for the infraction.', max_length=1000, null=True, blank=True)),
('infraction_duration', models.DurationField(help_text='The duration of the infraction. Null if permanent.', null=True)),
('infraction_channel', models.BigIntegerField(validators=(MinValueValidator(limit_value=0, message="Channel IDs cannot be negative."),), help_text="Channel in which to send the infraction.", null=True)),
@@ -133,12 +133,12 @@ class Migration(migrations.Migration):
('delete_messages', models.BooleanField(help_text='Whether this filter should delete messages triggering it.')),
('bypass_roles', django.contrib.postgres.fields.ArrayField(base_field=models.CharField(max_length=100), help_text='Roles and users who can bypass this filter.', size=None)),
('enabled', models.BooleanField(help_text='Whether this filter is currently enabled.')),
- ('dm_content', models.CharField(help_text='The DM to send to a user triggering this filter.', max_length=1000, null=True, blank=True)),
- ('dm_embed', models.CharField(help_text='The content of the DM embed', max_length=2000, null=True, blank=True)),
- ('infraction_type', models.CharField(choices=[('NOTE', 'Note'), ('WARNING', 'Warning'), ('WATCH', 'Watch'), ('MUTE', 'Mute'), ('KICK', 'Kick'), ('BAN', 'Ban'), ('SUPERSTAR', 'Superstar'), ('VOICE_BAN', 'Voice Ban'), ('VOICE_MUTE', 'Voice Mute')], help_text='The infraction to apply to this user.', max_length=10, null=True)),
- ('infraction_reason', models.CharField(help_text='The reason to give for the infraction.', max_length=1000, null=True, blank=True)),
- ('infraction_duration', models.DurationField(help_text='The duration of the infraction. Null if permanent.', null=True)),
- ('infraction_channel', models.BigIntegerField(validators=(MinValueValidator(limit_value=0, message="Channel IDs cannot be negative."),), help_text="Channel in which to send the infraction.", null=True)),
+ ('dm_content', models.CharField(help_text='The DM to send to a user triggering this filter.', max_length=1000, blank=True)),
+ ('dm_embed', models.CharField(help_text='The content of the DM embed', max_length=2000, blank=True)),
+ ('infraction_type', models.CharField(choices=[('NONE', 'None'), ('NOTE', 'Note'), ('WARNING', 'Warning'), ('WATCH', 'Watch'), ('MUTE', 'Mute'), ('KICK', 'Kick'), ('BAN', 'Ban'), ('SUPERSTAR', 'Superstar'), ('VOICE_BAN', 'Voice Ban'), ('VOICE_MUTE', 'Voice Mute')], help_text='The infraction to apply to this user.', max_length=10)),
+ ('infraction_reason', models.CharField(help_text='The reason to give for the infraction.', max_length=1000, blank=True)),
+ ('infraction_duration', models.DurationField(help_text='The duration of the infraction. Null if permanent.')),
+ ('infraction_channel', models.BigIntegerField(validators=(MinValueValidator(limit_value=0, message="Channel IDs cannot be negative."),), help_text="Channel in which to send the infraction.")),
('disabled_channels', django.contrib.postgres.fields.ArrayField(base_field=models.CharField(max_length=100), help_text="Channels in which to not run the filter.", size=None)),
('disabled_categories', django.contrib.postgres.fields.ArrayField(base_field=models.CharField(max_length=100), help_text="Categories in which to not run the filter.", size=None)),
('enabled_channels', django.contrib.postgres.fields.ArrayField(base_field=models.CharField(max_length=100), help_text="Channels in which to run the filter even if it's disabled in the category.", size=None)),
diff --git a/pydis_site/apps/api/migrations/0086_unique_constraint_filters.py b/pydis_site/apps/api/migrations/0086_unique_constraint_filters.py
index e7816e19..6fa99e9e 100644
--- a/pydis_site/apps/api/migrations/0086_unique_constraint_filters.py
+++ b/pydis_site/apps/api/migrations/0086_unique_constraint_filters.py
@@ -13,15 +13,15 @@ class Migration(migrations.Migration):
migrations.AddConstraint(
model_name='filter',
constraint=models.UniqueConstraint(fields=(
+ 'content',
+ 'additional_field',
+ 'filter_list',
'dm_content',
'dm_embed',
'infraction_type',
'infraction_reason',
'infraction_duration',
'infraction_channel',
- 'content',
- 'additional_field',
- 'filter_list',
'guild_pings',
'filter_dm',
'dm_pings',
diff --git a/pydis_site/apps/api/migrations/0087_unique_filter_list.py b/pydis_site/apps/api/migrations/0087_unique_filter_list.py
index 843bb00a..9db966fb 100644
--- a/pydis_site/apps/api/migrations/0087_unique_filter_list.py
+++ b/pydis_site/apps/api/migrations/0087_unique_filter_list.py
@@ -22,10 +22,10 @@ def create_unique_list(apps: Apps, _):
enabled=True,
dm_content="",
dm_embed="",
- infraction_type="",
+ infraction_type="NONE",
infraction_reason="",
infraction_duration=timedelta(seconds=0),
- infraction_channel=None,
+ infraction_channel=0,
disabled_channels=[],
disabled_categories=[],
enabled_channels=[],
diff --git a/pydis_site/apps/api/migrations/0088_antispam_filter_list.py b/pydis_site/apps/api/migrations/0088_antispam_filter_list.py
index d425293f..354e4520 100644
--- a/pydis_site/apps/api/migrations/0088_antispam_filter_list.py
+++ b/pydis_site/apps/api/migrations/0088_antispam_filter_list.py
@@ -22,10 +22,10 @@ def create_antispam_list(apps: Apps, _):
enabled=True,
dm_content="",
dm_embed="",
- infraction_type="mute",
+ infraction_type="MUTE",
infraction_reason="",
infraction_duration=timedelta(seconds=600),
- infraction_channel=None,
+ infraction_channel=0,
disabled_channels=[],
disabled_categories=["CODE JAM"],
enabled_channels=[],