Fixed transaction checking.
Now the default value for the form is set to the value given in TransactionType.needsCheck
This commit is contained in:
parent
eaf1551fa1
commit
fd46332e65
|
@ -11,3 +11,7 @@ class TransactionForm(forms.ModelForm):
|
|||
def clean_amount(self):
|
||||
data = self.cleaned_data['amount']
|
||||
return data
|
||||
def clean(self):
|
||||
cleaned_data = super(TransactionForm, self).clean()
|
||||
self.instance.checked = not cleaned_data['transactionType'].needsCheck
|
||||
return cleaned_data
|
||||
|
|
Loading…
Reference in New Issue