Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Dépôt de besoin] Permettre aux admin d'indiquer que le besoin n'a PAS transactionné #920

Merged
merged 2 commits into from
Sep 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Generated by Django 4.2.2 on 2023-09-26 08:05

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"),
]

operations = [
migrations.AlterField(
model_name="tender",
name="siae_transactioned",
field=models.BooleanField(
blank=True,
help_text="Champ renseigné par un ADMIN",
null=True,
verbose_name="Abouti à une transaction avec une structure",
),
),
migrations.RunPython(code=set_siae_transactioned_false_to_null),
]
3 changes: 2 additions & 1 deletion lemarche/tenders/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,8 @@ class Tender(models.Model):
siae_transactioned = models.BooleanField(
verbose_name="Abouti à une transaction avec une structure",
help_text="Champ renseigné par un ADMIN",
default=False,
blank=True,
null=True,
)
amount_exact = models.PositiveIntegerField(
verbose_name="Montant exact du besoin", help_text="Champ renseigné par un ADMIN", blank=True, null=True
Expand Down