From effda9e4267b9a88b2b38e5e240b43f83879a1a7 Mon Sep 17 00:00:00 2001 From: madjid-asa Date: Wed, 25 Oct 2023 16:04:19 +0200 Subject: [PATCH] =?UTF-8?q?Fix=20du=20nom=20de=20l'entreprise=20d'un=20d?= =?UTF-8?q?=C3=A9p=C3=B4t=20de=20besoin=20(#945)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Not pop the value of contact_company_name * remove useless specific field --- lemarche/api/tenders/serializers.py | 1 - lemarche/www/tenders/utils.py | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/lemarche/api/tenders/serializers.py b/lemarche/api/tenders/serializers.py index 418e45173..0caf4de69 100644 --- a/lemarche/api/tenders/serializers.py +++ b/lemarche/api/tenders/serializers.py @@ -13,7 +13,6 @@ class TenderSerializer(serializers.ModelSerializer): location = serializers.SlugRelatedField( queryset=Perimeter.objects.all(), slug_field="slug", allow_null=True, required=False ) - contact_company_name = serializers.CharField(required=False) extra_data = serializers.JSONField(required=False) class Meta: diff --git a/lemarche/www/tenders/utils.py b/lemarche/www/tenders/utils.py index 8f3aace67..ebea9ed26 100644 --- a/lemarche/www/tenders/utils.py +++ b/lemarche/www/tenders/utils.py @@ -59,7 +59,7 @@ def get_or_create_user_from_anonymous_content(tender_dict: dict, source: str = U "first_name": tender_dict.get("contact_first_name"), "last_name": tender_dict.get("contact_last_name"), "phone": tender_dict.get("contact_phone"), - "company_name": tender_dict.pop("contact_company_name") + "company_name": tender_dict.get("contact_company_name") if tender_dict.get("contact_company_name") else "Particulier", "kind": User.KIND_BUYER, # not necessarily true, could be a PARTNER