1
0
mirror of https://gitlab.crans.org/bde/nk20 synced 2025-06-25 11:37:22 +02:00

Tests et permissions

This commit is contained in:
Ehouarn
2025-06-02 17:51:33 +02:00
parent e617048332
commit 40ac1daece
3 changed files with 16 additions and 8 deletions

View File

@ -1084,12 +1084,12 @@ class WEIValidateRegistrationView(ProtectQuerysetMixin, ProtectedCreateView):
# Vérifier que l'utilisateur a assez d'argent pour tout payer
if not registration.soge_credit and user.note.balance + credit_amount < total_needed:
form.add_error('credit_type',
_("This user doesn't have enough money to join this club and pay the deposit. "
"Current balance: %(balance)d€, credit: %(credit)d€, needed: %(needed)d") % {
'balance': user.note.balance,
'credit': credit_amount,
'needed': total_needed,
})
_("This user doesn't have enough money to join this club and pay the deposit. "
"Current balance: %(balance)d€, credit: %(credit)d€, needed: %(needed)d") % {
'balance': user.note.balance,
'credit': credit_amount,
'needed': total_needed}
)
return super().form_invalid(form)
if credit_amount: