From 638359c132b7aed181906f2be3106337f4dc2d5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Reuiller?= Date: Tue, 10 Oct 2023 16:02:57 +0200 Subject: [PATCH] also remove steps data in csrf way --- lemarche/www/pages/views.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lemarche/www/pages/views.py b/lemarche/www/pages/views.py index 52fe8cd04..b9ad96b6f 100644 --- a/lemarche/www/pages/views.py +++ b/lemarche/www/pages/views.py @@ -15,7 +15,7 @@ from lemarche.sectors.models import Sector from lemarche.siaes.models import Siae, SiaeGroup from lemarche.tenders import constants as tender_constants -from lemarche.tenders.models import Tender +from lemarche.tenders.models import Tender, TenderStepsData from lemarche.users.models import User from lemarche.utils.tracker import track from lemarche.www.pages.forms import ( @@ -357,6 +357,11 @@ def csrf_failure(request, reason=""): # noqa C901 tender.save() tender.set_siae_found_list() + # remove steps data + uuid = request.session.get("tender_steps_data_uuid", None) + if uuid: + TenderStepsData.objects.filter(uuid=uuid).delete() + if settings.BITOUBI_ENV == "prod": notify_admin_tender_created(tender)