From 64b5e7249bd1b9af5a4e1d88f0dd8468113a7b03 Mon Sep 17 00:00:00 2001 From: Raphael Odini Date: Mon, 4 Mar 2024 14:35:16 +0100 Subject: [PATCH] New field Tender.admins --- .../tenders/migrations/0078_tender_admins.py | 25 +++++++++++++++++++ lemarche/tenders/models.py | 8 ++++++ 2 files changed, 33 insertions(+) create mode 100644 lemarche/tenders/migrations/0078_tender_admins.py diff --git a/lemarche/tenders/migrations/0078_tender_admins.py b/lemarche/tenders/migrations/0078_tender_admins.py new file mode 100644 index 000000000..905f00430 --- /dev/null +++ b/lemarche/tenders/migrations/0078_tender_admins.py @@ -0,0 +1,25 @@ +# Generated by Django 4.2.9 on 2024-03-04 13:32 + +from django.conf import settings +from django.db import migrations, models + + +class Migration(migrations.Migration): + dependencies = [ + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ("tenders", "0077_alter_tender_siae_kind"), + ] + + operations = [ + migrations.AddField( + model_name="tender", + name="admins", + field=models.ManyToManyField( + blank=True, + help_text="Champ renseigné par un ADMIN", + related_name="tenders_admins", + to=settings.AUTH_USER_MODEL, + verbose_name="Admin(s) du besoin", + ), + ), + ] diff --git a/lemarche/tenders/models.py b/lemarche/tenders/models.py index cdc966730..89738054d 100644 --- a/lemarche/tenders/models.py +++ b/lemarche/tenders/models.py @@ -561,6 +561,14 @@ class Tender(models.Model): siae_list_last_seen_date = models.DateTimeField( "Date de dernière visite de l'auteur sur la page 'structures intéressées'", blank=True, null=True ) + + admins = models.ManyToManyField( + "users.User", + verbose_name="Admin(s) du besoin", + help_text=ADMIN_FIELD_HELP_TEXT, + related_name="tenders_admins", + blank=True, + ) logs = models.JSONField(verbose_name="Logs historiques", editable=False, default=list) source = models.CharField( verbose_name="Source",