Deduction validity checking

* fixes behaviour of related deduction checks on intervention checking
This commit is contained in:
mpeltriaux 2023-08-31 11:31:33 +02:00
parent 5d734638ab
commit 4a70408ec3

View File

@ -43,6 +43,7 @@ class CheckModalForm(BaseModalForm):
"""
deductions = self.instance.deductions.all()
valid = True
for deduction in deductions:
checker = deduction.account.quality_check()
for msg in checker.messages:
@ -50,8 +51,8 @@ class CheckModalForm(BaseModalForm):
"checked_comps",
f"{deduction.account.identifier}: {msg}"
)
return checker.valid
return True
valid &= checker.valid
return valid
def _are_comps_valid(self):
""" Performs validity checks on all types of compensations