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:
@ -57,10 +57,9 @@ class NoOffsetNominalAccount:
|
||||
"""The validator to check nominal account is not to be offset."""
|
||||
|
||||
def __call__(self, form: FlaskForm, field: BooleanField) -> None:
|
||||
assert isinstance(form, AccountForm)
|
||||
if not field.data:
|
||||
return
|
||||
if not isinstance(form, AccountForm):
|
||||
return
|
||||
if form.base_code.data is None:
|
||||
return
|
||||
if form.base_code.data[0] not in {"1", "2"}:
|
||||
|
Reference in New Issue
Block a user