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