From ee959809ad56727a2f0766f00723ecc1a9d9d33b Mon Sep 17 00:00:00 2001 From: mpeltriaux Date: Fri, 4 Feb 2022 15:59:53 +0100 Subject: [PATCH] # 108 * fixes bug --- intervention/utils/quality.py | 5 ++++- konova/forms.py | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/intervention/utils/quality.py b/intervention/utils/quality.py index e15b4ca4..6135b403 100644 --- a/intervention/utils/quality.py +++ b/intervention/utils/quality.py @@ -89,7 +89,10 @@ class InterventionQualityChecker(AbstractQualityChecker): Returns: """ - c_comps = self.obj.compensations.count() + comps = self.obj.compensations.filter( + deleted=None + ) + c_comps = comps.count() c_pays = self.obj.payments.count() c_deducs = self.obj.deductions.count() c_all = c_comps + c_pays + c_deducs diff --git a/konova/forms.py b/konova/forms.py index 030599c3..ab55cb75 100644 --- a/konova/forms.py +++ b/konova/forms.py @@ -515,7 +515,9 @@ class RecordModalForm(BaseModalForm): Returns: """ - comps = self.instance.compensations.all() + comps = self.instance.compensations.filter( + deleted=None, + ) comps_valid = True for comp in comps: checker = comp.quality_check()