Fixed Transaction ,-usage and error for transactiontype
This commit is contained in:
parent
b71b95436f
commit
9bad46cf2d
|
@ -23,7 +23,7 @@ class CurrencyField (forms.RegexField):
|
|||
self.currencyRe, None, None, *args, **kwargs)
|
||||
def to_python(self, value):
|
||||
try:
|
||||
value = Decimal(value)
|
||||
value = Decimal(value.replace(",", "."))
|
||||
except (ValueError, TypeError, InvalidOperation):
|
||||
raise ValidationError("Bitte gib eine Zahl ein")
|
||||
return value
|
||||
|
|
|
@ -18,7 +18,8 @@ class TransactionForm(forms.ModelForm):
|
|||
def clean(self):
|
||||
# needed to enforce TransactionTypes needsCheck "default value"
|
||||
cleaned_data = super(TransactionForm, self).clean()
|
||||
self.instance.checked = not cleaned_data['transactionType'].needsCheck
|
||||
if cleaned_data.has_key("transactionType"):
|
||||
self.instance.checked = not cleaned_data['transactionType'].needsCheck
|
||||
return cleaned_data
|
||||
|
||||
class VirtualTransactionForm(forms.ModelForm):
|
||||
|
|
Loading…
Reference in New Issue