diff --git a/lemarche/www/pages/views.py b/lemarche/www/pages/views.py index b9ad96b6f..08dcebd87 100644 --- a/lemarche/www/pages/views.py +++ b/lemarche/www/pages/views.py @@ -306,7 +306,11 @@ def csrf_failure(request, reason=""): # noqa C901 for key in formtools_session_step_data.get(step).keys(): if not key.startswith(("csrfmiddlewaretoken", "tender_create_multi_step_view")): value = formtools_session_step_data.get(step).get(key) - key_cleaned = key.replace(f"{step}-", "") + if step in ["general", "detail", "contact", "survey", "confirmation"]: + key_cleaned = key.replace(f"{step}-", "") + else: + continue + print("step, value, key_cleaned", step, value, key_cleaned) if key_cleaned == "le_marche_doesnt_exist_how_to_find_siae": tender_dict["extra_data"] |= {key_cleaned: value[0]} elif key_cleaned == "location": @@ -320,6 +324,10 @@ def csrf_failure(request, reason=""): # noqa C901 elif key_cleaned == "sectors": tender_dict[key_cleaned] = Sector.objects.filter(slug__in=value) + elif key_cleaned == "questions_list" and value: + tender_dict[key_cleaned] = json.loads(value[0]) + elif key_cleaned == "alpine-questions_list": + continue elif key_cleaned not in [ "response_kind", "is_country_area", @@ -333,6 +341,9 @@ def csrf_failure(request, reason=""): # noqa C901 else: # response_kind, marche_benefits tender_dict[key_cleaned] = list() if value[0] == "" else value # get user + import ipdb + + ipdb.set_trace() if not request.user.is_authenticated: user = get_or_create_user_from_anonymous_content(tender_dict, source=User.SOURCE_TENDER_FORM) else: