From 9ad3e9e972cb9b29a8ef67a69adc6bca1971eca9 Mon Sep 17 00:00:00 2001 From: Jean-Marie Favreau Date: Tue, 19 Nov 2024 20:36:05 +0100 Subject: [PATCH] =?UTF-8?q?On=20supprime=20la=20cr=C3=A9ation=20de=20tags?= =?UTF-8?q?=20pendant=20la=20migration?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../migrations/0099_update_categories.py | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/src/agenda_culturel/migrations/0099_update_categories.py b/src/agenda_culturel/migrations/0099_update_categories.py index ef99df5..d7eb59e 100644 --- a/src/agenda_culturel/migrations/0099_update_categories.py +++ b/src/agenda_culturel/migrations/0099_update_categories.py @@ -184,15 +184,6 @@ def update_database_new(apps, schema_editor): def update_database_old(apps, schema_editor): update_database(apps, new_cats) -def add_tags(apps, schema_editor): - Tag = apps.get_model("agenda_culturel", "Tag") - - new_tags = ["cinéma", "théâtre", "concert", "conférence", "exposition"] - - new_tags = [Tag(name=t, description="", principal=True) for t in new_tags if Tag.objects.filter(name=t).count() == 0] - - Tag.objects.bulk_create(new_tags) - def do_nothing(apps, schema_editor): pass @@ -206,7 +197,6 @@ class Migration(migrations.Migration): migrations.RunPython(create_new_categories, reverse_code=delete_new_categories), migrations.RunPython(update_preserved_categories_new, reverse_code=update_preserved_categories_old), migrations.RunPython(update_database_new, reverse_code=update_database_old), - migrations.RunPython(delete_old_categories, reverse_code=create_old_categories), - migrations.RunPython(add_tags, reverse_code=do_nothing) + migrations.RunPython(delete_old_categories, reverse_code=create_old_categories) ]