Browse Source

get_object_or_404 au lieu de get_or_create dans le clean du rechargeForm.

fix_front_profil
Hugo LEVY-FALK 8 years ago
parent
commit
7c7455f9bc
  1. 3
      cotisations/forms.py

3
cotisations/forms.py

@ -290,8 +290,7 @@ class RechargeForm(FormRevMixin, Form):
the value is well inside the possible limits
"""
value = self.cleaned_data['value']
balance_method, _created = balance.PaymentMethod\
.objects.get_or_create()
balance_method, _created = get_object_or_404(balance.PaymentMethod)
if balance_method.maximum_balance is not None and \
value + self.user.solde > balance_method.maximum_balance:
raise forms.ValidationError(

Loading…
Cancel
Save