From be6b69824fbcfdc1c73f17eefa31e81f04b704a3 Mon Sep 17 00:00:00 2001 From: Chris Lovering Date: Tue, 19 Sep 2023 11:29:39 +0100 Subject: [PATCH] Remove the redirect FilterList on migration This redirect filter list does not have any filters, nor does it have a bot implementation. It is something that we were working on, but has been stalled for a while. The presence of this filter list also causes the bot to warn on startup due to it finding a filter list with no implementation. This commit removes the FilterList, which can be added back if/when we support this filter type in bot. --- .../0092_remove_redirect_filter_list.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 pydis_site/apps/api/migrations/0092_remove_redirect_filter_list.py diff --git a/pydis_site/apps/api/migrations/0092_remove_redirect_filter_list.py b/pydis_site/apps/api/migrations/0092_remove_redirect_filter_list.py new file mode 100644 index 000000000..69dd99d00 --- /dev/null +++ b/pydis_site/apps/api/migrations/0092_remove_redirect_filter_list.py @@ -0,0 +1,16 @@ +from django.db import migrations +from django.apps.registry import Apps +from django.db.backends.base.schema import BaseDatabaseSchemaEditor + + +def forward(apps: Apps, _: BaseDatabaseSchemaEditor) -> None: + apps.get_model("api", "FilterList").objects.filter(name="redirect").delete() + + +class Migration(migrations.Migration): + + dependencies = [ + ("api", "0091_antispam_filter_list"), + ] + + operations = [migrations.RunPython(forward)]