From ff68d74a85180c9462e3dd87c1d7ef9d1bf89d67 Mon Sep 17 00:00:00 2001 From: Laetitia Gangloff Date: Thu, 30 Apr 2015 15:51:06 +0200 Subject: [PATCH] add help in view, use NameError instead of ValueError --- mis_builder/models/mis_builder.py | 4 ++-- mis_builder/views/mis_builder.xml | 27 +++++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/mis_builder/models/mis_builder.py b/mis_builder/models/mis_builder.py index 56f9b964..3e4cf638 100644 --- a/mis_builder/models/mis_builder.py +++ b/mis_builder/models/mis_builder.py @@ -144,7 +144,7 @@ class mis_report_kpi(orm.Model): res = {} if name and not _is_valid_python_var(name): res['warning'] = { - 'title': 'Invalid name', + 'title': 'Invalid name %s' % name, 'message': 'The name must be a valid python identifier'} return res @@ -578,7 +578,7 @@ class mis_report_instance_period(orm.Model): kpi_val = None kpi_val_rendered = '#DIV/0' kpi_val_comment += '\n\n%s' % (traceback.format_exc(),) - except ValueError: + except NameError: recompute_queue.append(kpi) kpi_val = None kpi_val_rendered = '#ERR' diff --git a/mis_builder/views/mis_builder.xml b/mis_builder/views/mis_builder.xml index f93e1fcd..78178295 100644 --- a/mis_builder/views/mis_builder.xml +++ b/mis_builder/views/mis_builder.xml @@ -58,6 +58,33 @@ + + + + + +