Skip to content

Commit

Permalink
Init command in migration
Browse files Browse the repository at this point in the history
  • Loading branch information
raphodn committed Sep 26, 2023
1 parent 1e24bf9 commit 446437c
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@
from django.db import migrations, models


def set_siae_transactioned_false_to_null(apps, schema_editor):
Tender = apps.get_model("tenders", "Tender")
for tender in Tender.objects.filter(siae_transactioned=False, survey_transactioned_answer=None):
tender.siae_transactioned = None
tender.save(update_fields=["siae_transactioned"])


class Migration(migrations.Migration):
dependencies = [
("tenders", "0056_alter_tender_scale_marche_useless"),
Expand All @@ -19,4 +26,5 @@ class Migration(migrations.Migration):
verbose_name="Abouti à une transaction avec une structure",
),
),
migrations.RunPython(code=set_siae_transactioned_false_to_null),
]

0 comments on commit 446437c

Please sign in to comment.