From 55aec35a705c5401ecfee4cf475b5ae1ced7ee86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Reuiller?= Date: Thu, 14 Sep 2023 18:20:26 +0200 Subject: [PATCH 1/2] [tender form] remove fields presta_type, accept cocontracting and constraints --- .../tenders/create_step_description.html | 23 ------------------- .../tenders/create_step_general.html | 5 ---- lemarche/www/pages/views.py | 5 +--- lemarche/www/tenders/forms.py | 12 ---------- lemarche/www/tenders/tests.py | 2 -- 5 files changed, 1 insertion(+), 46 deletions(-) diff --git a/lemarche/templates/tenders/create_step_description.html b/lemarche/templates/tenders/create_step_description.html index 36475b7d7..298811c6e 100644 --- a/lemarche/templates/tenders/create_step_description.html +++ b/lemarche/templates/tenders/create_step_description.html @@ -55,23 +55,6 @@

Questions à poser aux prestataires ciblés

-
-
{% bootstrap_field form.constraints %}
-
-
-
-

- Conseil -
- Les contraintes techniques spécifiques sont les exigences que vous souhaitez porter à la connaissance des prestataires inclusifs. -

-

- Plus elles seront précises, plus vous aurez de chances de recevoir des réponses qualitatives des prestataires inclusifs. -

-
-
-
-
@@ -96,12 +79,6 @@

Questions à poser aux prestataires ciblés

-
-
- - {% bootstrap_field form.accept_cocontracting %} -
-
{% endblock content_form %} {% block extra_js %} -{% endblock %} diff --git a/lemarche/tenders/migrations/0056_alter_tender_scale_marche_useless.py b/lemarche/tenders/migrations/0056_alter_tender_scale_marche_useless.py new file mode 100644 index 000000000..51ed82899 --- /dev/null +++ b/lemarche/tenders/migrations/0056_alter_tender_scale_marche_useless.py @@ -0,0 +1,26 @@ +# Generated by Django 4.2.2 on 2023-09-18 08:49 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + dependencies = [ + ("tenders", "0055_tender_contact_company_name"), + ] + + operations = [ + migrations.AlterField( + model_name="tender", + name="scale_marche_useless", + field=models.CharField( + choices=[("0", "Non"), ("1", "Peu probablement"), ("2", "Très probablement"), ("3", "Oui")], + default="0", + help_text=( + "Si le Marché de l'inclusion n'existait pas, auriez-vous " + "consulté des prestataires inclusifs* pour ce besoin ?" + ), + max_length=2, + verbose_name="Utilité du marché de l'inclusion", + ), + ), + ] diff --git a/lemarche/tenders/models.py b/lemarche/tenders/models.py index 5d60fc41a..a85ba0f47 100644 --- a/lemarche/tenders/models.py +++ b/lemarche/tenders/models.py @@ -328,7 +328,7 @@ class Tender(models.Model): # survey scale_marche_useless = models.CharField( verbose_name="Utilité du marché de l'inclusion", - help_text="Q°1. Si le Marché de l'inclusion n'existait pas, auriez-vous consulté des prestataires inclusifs* pour ce besoin ?", # noqa + help_text="Si le Marché de l'inclusion n'existait pas, auriez-vous consulté des prestataires inclusifs* pour ce besoin ?", # noqa max_length=2, choices=tender_constants.SURVEY_SCALE_QUESTION_CHOICES, default=tender_constants.SURVEY_SCALE_QUESTION_0, diff --git a/lemarche/www/pages/views.py b/lemarche/www/pages/views.py index 8ebd9653f..52fe8cd04 100644 --- a/lemarche/www/pages/views.py +++ b/lemarche/www/pages/views.py @@ -307,12 +307,7 @@ def csrf_failure(request, reason=""): # noqa C901 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 key_cleaned in [ - "le_marche_doesnt_exist_how_to_find_siae", - "providers_out_of_insertion", - "worked_with_inclusif_siae_this_kind_tender", - "is_encouraged_by_le_marche", - ]: + if key_cleaned == "le_marche_doesnt_exist_how_to_find_siae": tender_dict["extra_data"] |= {key_cleaned: value[0]} elif key_cleaned == "location": tender_dict[key_cleaned] = Perimeter.objects.get(slug=value[0]) diff --git a/lemarche/www/tenders/forms.py b/lemarche/www/tenders/forms.py index 876f76223..388dce1a4 100644 --- a/lemarche/www/tenders/forms.py +++ b/lemarche/www/tenders/forms.py @@ -223,29 +223,8 @@ class TenderCreateStepSurveyForm(forms.ModelForm): required=True, ) - worked_with_inclusif_siae_this_kind_tender = forms.ChoiceField( - label="Q°2. Avez-vous déjà travaillé avec des prestataires inclusifs sur ce type de prestation ?", - choices=tender_constants.SURVEY_YES_NO_DONT_KNOW_CHOICES, - widget=forms.RadioSelect, - required=True, - ) - # hidden if worked_with_inclusif_siae_this_kind_tender is no or don't know - is_encouraged_by_le_marche = forms.ChoiceField( - label="Q°3. Est-ce la plateforme du Marché de l'inclusion qui vous a encouragé à consulter des prestataires inclusifs pour ce besoin ?", # noqa - choices=tender_constants.SURVEY_ENCOURAGED_BY_US_CHOICES, - widget=forms.RadioSelect, - required=False, - ) - - providers_out_of_insertion = forms.ChoiceField( - label="Q°4. Comptez-vous consulter d'autres prestataires en dehors de l'Insertion et du Handicap ?", - choices=tender_constants.SURVEY_SCALE_QUESTION_CHOICES, - widget=forms.RadioSelect, - required=True, - ) - le_marche_doesnt_exist_how_to_find_siae = forms.CharField( - label="Q°5. Si le Marché de l'inclusion n'existait pas, comment auriez-vous fait pour trouver un prestataire inclusif ?", # noqa + label="Si le Marché de l'inclusion n'existait pas, comment auriez-vous fait pour trouver un prestataire inclusif ?", # noqa required=False, widget=forms.Textarea(attrs={"rows": 2, "cols": 15, "data-expandable": "true"}), ) @@ -259,11 +238,6 @@ class Meta: def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) if self.instance.id: - self.initial["worked_with_inclusif_siae_this_kind_tender"] = self.instance.extra_data.get( - "worked_with_inclusif_siae_this_kind_tender" - ) - self.initial["is_encouraged_by_le_marche"] = self.instance.extra_data.get("is_encouraged_by_le_marche") - self.initial["providers_out_of_insertion"] = self.instance.extra_data.get("providers_out_of_insertion") self.initial["le_marche_doesnt_exist_how_to_find_siae"] = self.instance.extra_data.get( "le_marche_doesnt_exist_how_to_find_siae" ) diff --git a/lemarche/www/tenders/tests.py b/lemarche/www/tenders/tests.py index 0a7eed5f7..bdd6598c2 100644 --- a/lemarche/www/tenders/tests.py +++ b/lemarche/www/tenders/tests.py @@ -66,9 +66,6 @@ def _generate_fake_data_form( step_4 = { "tender_create_multi_step_view-current_step": "survey", "survey-scale_marche_useless": tender_constants.SURVEY_SCALE_QUESTION_0, - "survey-worked_with_inclusif_siae_this_kind_tender": tender_constants.SURVEY_DONT_KNOW, - "survey-is_encouraged_by_le_marche": tender_constants.SURVEY_NOT_ENCOURAGED_ONLY_BY_US, - "survey-providers_out_of_insertion": tender_constants.SURVEY_SCALE_QUESTION_2, "survey-le_marche_doesnt_exist_how_to_find_siae": "TEST", } | _step_4