From f5b84177426cd6a49556fdccf25f67510dc96e7d Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Wed, 27 Aug 2025 14:38:46 +0200 Subject: 🚑️ templates - archaeological files - "redevance": fix templates with inconsistent data MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- archaeological_files/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'archaeological_files/models.py') diff --git a/archaeological_files/models.py b/archaeological_files/models.py index 1aeb191cf..33af742ac 100644 --- a/archaeological_files/models.py +++ b/archaeological_files/models.py @@ -1323,13 +1323,13 @@ class File( q = GlobalVar.objects.filter(slug="taux_rap") if q.count(): try: - values["redevance"] = float(q.all()[0].value) * self.total_surface + values["redevance"] = float(q.all()[0].value or 0) * (self.total_surface or 0) except ValueError: pass q = GlobalVar.objects.filter(slug="taux_tva") if q.count(): try: - values["equipments_cost_planned_tva"] = float(q.all()[0].value) * float(values.get("equipments_cost_planned", 0)) + values["equipments_cost_planned_tva"] = float(q.all()[0].value or 0) * float(values.get("equipments_cost_planned", 0)) except ValueError: pass return values -- cgit v1.2.3