1
0
mirror of https://gitlab.crans.org/bde/nk20 synced 2025-06-20 17:41:55 +02:00

When an user is registering to the WEI, it doesn't pay the membership + the credit amount. The credit amount is deducted instead

This commit is contained in:
Yohann D'ANELLO
2020-08-10 19:59:01 +02:00
parent 999cc0a6b2
commit 6567d2f8cc
4 changed files with 19 additions and 17 deletions

View File

@ -160,7 +160,8 @@
<div class="alert alert-danger">
{% with pretty_fee=fee|pretty_money %}
{% blocktrans trimmed with balance=registration.user.note.balance|pretty_money %}
The note don't have enough money ({{ balance }}, {{ pretty_fee }} required). The registration may fail.
The note don't have enough money ({{ balance }}, {{ pretty_fee }} required).
The registration may fail if you don't credit the note now.
{% endblocktrans %}
{% endwith %}
</div>

View File

@ -855,7 +855,7 @@ class WEIValidateRegistrationView(ProtectQuerysetMixin, LoginRequiredMixin, Crea
form.add_error('bus', _("This user didn't give her/his caution check."))
return super().form_invalid(form)
if not registration.soge_credit and user.note.balance < fee + credit_amount:
if not registration.soge_credit and user.note.balance + credit_amount < fee:
# Users must have money before registering to the WEI.
form.add_error('bus',
_("This user don't have enough money to join this club, and can't have a negative balance."))