From a4c9230b7eeecc4cbce0c9b63d3fb88c46f96f4a Mon Sep 17 00:00:00 2001 From: Laetitia Gangloff Date: Thu, 11 Feb 2016 17:52:51 +0100 Subject: [PATCH] mis_builder : in compute do not set val in localdict if there was a computation error --- mis_builder/models/mis_builder.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mis_builder/models/mis_builder.py b/mis_builder/models/mis_builder.py index 3872233a..bf77cd9f 100644 --- a/mis_builder/models/mis_builder.py +++ b/mis_builder/models/mis_builder.py @@ -514,6 +514,7 @@ class MisReportInstancePeriod(models.Model): kpi_val_comment = kpi.name + " = " + kpi.expression kpi_eval_expression = aep.replace_expr(kpi.expression) kpi_val = safe_eval(kpi_eval_expression, localdict) + localdict[kpi.name] = kpi_val except ZeroDivisionError: kpi_val = None kpi_val_rendered = '#DIV/0' @@ -530,7 +531,6 @@ class MisReportInstancePeriod(models.Model): else: kpi_val_rendered = kpi.render(lang_id, kpi_val) - localdict[kpi.name] = kpi_val try: kpi_style = None if kpi.css_style: