Replaced the if checks with assert in the IsBalanced validator of the currency sub-form of the transaction form, the NoOffsetNominalAccount validator of the account form, and the CodeUnique validator of the currency form.
This commit is contained in:
src/accounting
@ -61,8 +61,7 @@ class IsBalanced:
|
||||
entries are equal."""
|
||||
|
||||
def __call__(self, form: FlaskForm, field: BooleanField) -> None:
|
||||
if not isinstance(form, TransferCurrencyForm):
|
||||
return
|
||||
assert isinstance(form, TransferCurrencyForm)
|
||||
if len(form.debit) == 0 or len(form.credit) == 0:
|
||||
return
|
||||
if form.debit_total != form.credit_total:
|
||||
|
Reference in New Issue
Block a user