mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-11-26 06:32:26 +00:00
get_object_or_404 au lieu de get_or_create dans le clean du rechargeForm.
This commit is contained in:
parent
f28ad9a12d
commit
7c7455f9bc
1 changed files with 1 additions and 2 deletions
|
@ -290,8 +290,7 @@ class RechargeForm(FormRevMixin, Form):
|
||||||
the value is well inside the possible limits
|
the value is well inside the possible limits
|
||||||
"""
|
"""
|
||||||
value = self.cleaned_data['value']
|
value = self.cleaned_data['value']
|
||||||
balance_method, _created = balance.PaymentMethod\
|
balance_method, _created = get_object_or_404(balance.PaymentMethod)
|
||||||
.objects.get_or_create()
|
|
||||||
if balance_method.maximum_balance is not None and \
|
if balance_method.maximum_balance is not None and \
|
||||||
value + self.user.solde > balance_method.maximum_balance:
|
value + self.user.solde > balance_method.maximum_balance:
|
||||||
raise forms.ValidationError(
|
raise forms.ValidationError(
|
||||||
|
|
Loading…
Reference in a new issue