diff --git a/diagnostic_word/migrations/0002_auto_20230224_1314.py b/diagnostic_word/migrations/0002_auto_20230224_1314.py index 6e4e1c5b8..cf41be95a 100644 --- a/diagnostic_word/migrations/0002_auto_20230224_1314.py +++ b/diagnostic_word/migrations/0002_auto_20230224_1314.py @@ -1,26 +1,6 @@ # Generated by Django 3.2.18 on 2023-02-24 13:14 - -from typing import Callable - from django.db import migrations -from config.storages import DefaultStorage - - -def forwards(apps, schema_editor): - WordTemplate: Callable = apps.get_model("diagnostic_word", "WordTemplate") # type: ignore - WordTemplate.objects.create( - slug="template-bilan-1", - description="Modèle Word pour générer le diagnostic téléchargeable", - filename_mask="{diagnostic_name} - {start_date} à {end_date} - issu de SPARTE.docx", - docx=DefaultStorage().open("word_templates/Modèle_de_portrait_v17.docx"), - ) - - -def backwards(apps, schema_editor): - WordTemplate: Callable = apps.get_model("diagnostic_word", "WordTemplate") # type: ignore - WordTemplate.objects.filter(slug="template-bilan-1").delete() - class Migration(migrations.Migration): dependencies = [ @@ -28,7 +8,6 @@ class Migration(migrations.Migration): ] operations = [ - migrations.RunPython(forwards, reverse_code=backwards), migrations.RunSQL( "DROP TABLE IF EXISTS django_docx_template_docxtemplate;", reverse_sql=migrations.RunSQL.noop,