From 8069f3e08094594dde31e653477c7647986a9e7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Reuiller?= Date: Tue, 16 Jan 2024 17:09:09 +0100 Subject: [PATCH] move constants in dedicatd file --- lemarche/tenders/constants.py | 12 ++++++++++++ lemarche/www/tenders/views.py | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/lemarche/tenders/constants.py b/lemarche/tenders/constants.py index 1f74d3f4a..313d031e9 100644 --- a/lemarche/tenders/constants.py +++ b/lemarche/tenders/constants.py @@ -133,3 +133,15 @@ (SOURCE_API, "API"), (SOURCE_TALLY, "TALLY"), ) + +TENDER_SIAE_SOURCE_EMAIL = "EMAIL" +TENDER_SIAE_SOURCE_DASHBOARD = "DASHBOARD" +TENDER_SIAE_SOURCE_LINK = "LINK" +TENDER_SIAE_SOURCE_AI = "AI" + +TENDER_SIAE_SOURCE_CHOICES = ( + (TENDER_SIAE_SOURCE_EMAIL, "E-mail"), + (TENDER_SIAE_SOURCE_DASHBOARD, "Dashboard"), + (TENDER_SIAE_SOURCE_LINK, "Lien"), + (TENDER_SIAE_SOURCE_AI, "IA"), +) diff --git a/lemarche/www/tenders/views.py b/lemarche/www/tenders/views.py index a078b72da..1f399df0e 100644 --- a/lemarche/www/tenders/views.py +++ b/lemarche/www/tenders/views.py @@ -349,7 +349,7 @@ def get(self, request, *args, **kwargs): if not user.has_tender_siae(self.object): for siae in user.siaes.all(): TenderSiae.objects.create( - tender=self.object, siae=siae, source=TenderSiae.TENDER_SIAE_SOURCE_LINK + tender=self.object, siae=siae, source=tender_constants.TENDER_SIAE_SOURCE_LINK ) # update stats TenderSiae.objects.filter(