1
0
mirror of https://gitlab.crans.org/bde/nk20 synced 2025-07-25 18:15:24 +02:00

Fixed 1A forms

This commit is contained in:
Ehouarn
2025-07-24 12:26:44 +02:00
parent bfa5734d55
commit 97597eb103
2 changed files with 8 additions and 4 deletions

View File

@ -149,6 +149,7 @@ SPDX-License-Identifier: GPL-3.0-or-later
<li>{% blocktrans trimmed with amount=fee|pretty_money %}
Membership fees: {{ amount }}
{% endblocktrans %}</li>
{% if not registration.first_year %}
{% if registration.deposit_type == 'note' %}
<li>{% blocktrans trimmed with amount=club.deposit_amount|pretty_money %}
Deposit (by Note transaction): {{ amount }}
@ -158,6 +159,7 @@ SPDX-License-Identifier: GPL-3.0-or-later
Deposit (by check): {{ amount }}
{% endblocktrans %}</li>
{% endif %}
{% endif %}
<li><strong>{% blocktrans trimmed with total=total_needed|pretty_money %}
Total needed: {{ total }}
{% endblocktrans %}</strong></li>

View File

@ -816,9 +816,12 @@ class WEIUpdateRegistrationView(ProtectQuerysetMixin, LoginRequiredMixin, Update
del form.fields["deposit_check"]
# S'assurer que le champ deposit_type est obligatoire pour les 2A+
if not self.object.first_year and "deposit_type" in form.fields:
form.fields["deposit_type"].required = True
form.fields["deposit_type"].help_text = _("Choose how you want to pay the deposit")
if "deposit_type" in form.fields:
if self.object.first_year:
del form.fields["deposit_type"]
else:
form.fields["deposit_type"].required = True
form.fields["deposit_type"].help_text = _("Choose how you want to pay the deposit")
return form
@ -879,7 +882,6 @@ class WEIUpdateRegistrationView(ProtectQuerysetMixin, LoginRequiredMixin, Update
information["preferred_roles_name"] = [role.name for role in choose_bus_form.cleaned_data["roles"]]
form.instance.information = information
# Sauvegarder le type de caution pour les 2A+
if "deposit_type" in form.cleaned_data:
form.instance.deposit_type = form.cleaned_data["deposit_type"]
form.instance.save()