From 2fa8783fd957303e267fb1015b21a2395b877a2a Mon Sep 17 00:00:00 2001 From: mpeltriaux Date: Thu, 31 Aug 2023 11:31:33 +0200 Subject: [PATCH] Deduction validity checking * fixes behaviour of related deduction checks on intervention checking --- intervention/forms/modals/check.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/intervention/forms/modals/check.py b/intervention/forms/modals/check.py index 4371dd2..cc06e63 100644 --- a/intervention/forms/modals/check.py +++ b/intervention/forms/modals/check.py @@ -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