forked from DGNum/gestioCOF
adapt code to is_checkout removal
This commit is contained in:
parent
cadaf43131
commit
d7740e66fe
6 changed files with 105 additions and 40 deletions
|
@ -313,11 +313,10 @@ class KPsulOperationForm(forms.ModelForm):
|
|||
widget = forms.HiddenInput())
|
||||
class Meta:
|
||||
model = Operation
|
||||
fields = ['type', 'amount', 'is_checkout', 'article', 'article_nb']
|
||||
fields = ['type', 'amount', 'article', 'article_nb']
|
||||
widgets = {
|
||||
'type': forms.HiddenInput(),
|
||||
'amount': forms.HiddenInput(),
|
||||
'is_checkout': forms.HiddenInput(),
|
||||
'article_nb': forms.HiddenInput(),
|
||||
}
|
||||
|
||||
|
@ -333,7 +332,6 @@ class KPsulOperationForm(forms.ModelForm):
|
|||
"Un achat nécessite un article et une quantité")
|
||||
if article_nb < 1:
|
||||
raise ValidationError("Impossible d'acheter moins de 1 article")
|
||||
self.cleaned_data['is_checkout'] = True
|
||||
elif type_ope and type_ope in [Operation.DEPOSIT, Operation.WITHDRAW]:
|
||||
if not amount or article or article_nb:
|
||||
raise ValidationError("Bad request")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue