From 03c1692123b9b4beb9b84fe890383717331aa94b Mon Sep 17 00:00:00 2001 From: "madjid.asa" Date: Tue, 7 Nov 2023 09:42:58 +0100 Subject: [PATCH] fix bug for test environnement --- lemarche/tenders/admin.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lemarche/tenders/admin.py b/lemarche/tenders/admin.py index 8882e14ed..99197f88e 100644 --- a/lemarche/tenders/admin.py +++ b/lemarche/tenders/admin.py @@ -1,5 +1,6 @@ from ckeditor.widgets import CKEditorWidget from django import forms +from django.conf import settings from django.contrib import admin from django.contrib.contenttypes.admin import GenericTabularInline from django.db import models @@ -488,7 +489,8 @@ def response_change(self, request, obj: Tender): if request.POST.get("_validate_tender"): update_and_send_tender_task(tender=obj) self.message_user(request, "Ce dépôt de besoin a été validé et envoyé aux structures") - api_hubspot.create_deal_from_tender(tender=obj) + if settings.BITOUBI_ENV == "prod": + api_hubspot.create_deal_from_tender(tender=obj) return HttpResponseRedirect(".") elif request.POST.get("_restart_tender"):