Skip to content

Commit

Permalink
[tender form] remove fields presta_type, accept cocontracting and con…
Browse files Browse the repository at this point in the history
…straints
  • Loading branch information
SebastienReuiller committed Sep 14, 2023
1 parent 9d9785c commit 725ab0e
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 46 deletions.
23 changes: 0 additions & 23 deletions lemarche/templates/tenders/create_step_description.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,23 +55,6 @@ <h4>Questions à poser aux prestataires ciblés</h4>
<button type="button" class="btn btn-info" x-on:click="addNewQuestion()">Ajouter une question</button>
</div>
</div>
<div class="row">
<div class="col-12 col-lg-7">{% bootstrap_field form.constraints %}</div>
<div class="col-12 col-lg-5">
<div class="c-form-conseil">
<div>
<p>
<i class="ri-lightbulb-line ri-lg mr-1"></i><strong>Conseil</strong>
<br />
Les contraintes techniques spécifiques sont les exigences que vous souhaitez porter à la connaissance des prestataires inclusifs.
</p>
<p>
Plus elles seront précises, plus vous aurez de chances de recevoir des réponses qualitatives des prestataires inclusifs.
</p>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-12 col-lg-7">
<span x-data="SocialImpactCalculatorComponent">
Expand All @@ -96,12 +79,6 @@ <h4>Questions à poser aux prestataires ciblés</h4>
</div>
</div>
</div>
<div class="row">
<div class="col-12 col-lg-7">
<label class="fake-label">Co-traitance</label>
{% bootstrap_field form.accept_cocontracting %}
</div>
</div>
{% endblock content_form %}
{% block extra_js %}
<script type="text/javascript"
Expand Down
5 changes: 0 additions & 5 deletions lemarche/templates/tenders/create_step_general.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,6 @@
{% bootstrap_field form.sectors form_group_class="form-group form-group-required use-multiselect" %}
</div>
</div>
<div class="row">
<div class="col-12 col-lg-7">
{% bootstrap_field form.presta_type %}
</div>
</div>
<div class="row">
<div class="col-12 col-lg-7">
<div class="form-group form-group-required {% if form.location.errors %}is-invalid{% endif %}">
Expand Down
5 changes: 1 addition & 4 deletions lemarche/www/pages/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,25 +320,22 @@ def csrf_failure(request, reason=""): # noqa C901
elif key_cleaned in [
"is_country_area",
"accept_share_amount",
"accept_cocontracting",
]:
tender_dict[key_cleaned] = value[0] == "on"

elif key_cleaned == "sectors":
tender_dict[key_cleaned] = Sector.objects.filter(slug__in=value)
elif key_cleaned not in [
"presta_type",
"response_kind",
"is_country_area",
"accept_share_amount",
"accept_cocontracting",
]:
if value[0]:
tender_dict[key_cleaned] = value[0]
elif key_cleaned == "is_draft":
tender_dict["status"] = tender_constants.STATUS_DRAFT
tender_dict["published_at"] = None
else: # presta_type, response_kind, marche_benefits
else: # response_kind, marche_benefits
tender_dict[key_cleaned] = list() if value[0] == "" else value
# get user
if not request.user.is_authenticated:
Expand Down
12 changes: 0 additions & 12 deletions lemarche/www/tenders/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,13 @@ class TenderCreateStepGeneralForm(forms.ModelForm):
to_field_name="slug",
required=True,
)
presta_type = forms.MultipleChoiceField(
label="Type(s) de prestation(s)",
choices=Tender._meta.get_field("presta_type").base_field.choices,
widget=forms.CheckboxSelectMultiple,
required=True,
)

class Meta:
model = Tender
fields = [
"kind",
"title",
"sectors",
"presta_type",
"location", # generated by js
"is_country_area",
]
Expand Down Expand Up @@ -78,11 +71,9 @@ class Meta:
"description",
"start_working_date",
"external_link",
"constraints",
"amount",
"why_amount_is_blank",
"accept_share_amount",
"accept_cocontracting",
]
widgets = {
"start_working_date": forms.widgets.DateInput(attrs={"class": "form-control", "type": "date"}),
Expand All @@ -108,11 +99,8 @@ def __init__(self, kind, questions_list=None, *args, **kwargs):
self.fields["external_link"].help_text = None
self.fields["amount"].label = "Montant € estimé de votre besoin"
self.fields["accept_share_amount"].label = self.fields["accept_share_amount"].help_text
self.fields["accept_cocontracting"].label = self.fields["accept_cocontracting"].help_text
self.fields["external_link"].widget.attrs["placeholder"] = "https://www.example.fr"
self.fields["constraints"].widget.attrs["placeholder"] = "Ex : Déplacements"
self.fields["accept_share_amount"].help_text = None
self.fields["accept_cocontracting"].help_text = None

def clean_questions_list(self):
questions = self.cleaned_data["questions_list"]
Expand Down
2 changes: 0 additions & 2 deletions lemarche/www/tenders/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ def _generate_fake_data_form(
"general-kind": tender_not_saved.kind,
"general-title": tender_not_saved.title,
"general-sectors": cls.sectors,
"general-presta_type": siae_constants.PRESTA_BUILD,
"general-location": cls.location_slug,
"general-is_country_area": tender_not_saved.is_country_area,
} | _step_1
Expand All @@ -52,7 +51,6 @@ def _generate_fake_data_form(
"description-description": tender_not_saved.description,
"description-start_working_date": tender_not_saved.start_working_date,
"description-external_link": tender_not_saved.external_link,
"description-constraints": tender_not_saved.constraints,
"description-amount": tender_constants.AMOUNT_RANGE_1000_MORE,
} | _step_2
step_3 = {
Expand Down

0 comments on commit 725ab0e

Please sign in to comment.