Commit 7d7b2778 authored by LE GAC Renaud's avatar LE GAC Renaud
Browse files

check that the period is defined in report controllers.

parent 7df213b8
......@@ -8,7 +8,7 @@ import re
from plugin_dbui import INLINE_ALERT
from report_objects import do_title, Graph, List, Metric1D, Metric2D
from selector import MySelector
from selector import MySelector, SelectorActiveItemsException
def graph_extjs():
......@@ -47,8 +47,13 @@ def graph_mpl():
"""
# selector and configuration
ui_table = virtdb.graph_selector
selector = MySelector(ui_table)
try:
ui_table = virtdb.graph_selector
selector = MySelector(ui_table)
except SelectorActiveItemsException as e:
return INLINE_ALERT % (T("Error..."), T(str(e)))
config = db.graphs[request.vars.id_graphs]
# build the graph
......@@ -80,9 +85,13 @@ def grid():
The identifier is used to instantiate the proper class.
"""
ui_table = virtdb.grid_selector
selector = MySelector(ui_table)
try:
ui_table = virtdb.grid_selector
selector = MySelector(ui_table)
except SelectorActiveItemsException as e:
return INLINE_ALERT % (T("Error..."), T(str(e)))
# extract the report configuration and the build the report
try:
if "id_lists" in request.vars:
......
......@@ -102,6 +102,7 @@
'enter an integer between %(min)g and %(max)g': 'enter an integer between %(min)g and %(max)g',
'enter date as %(format)s': 'enter date as %(format)s',
'Error': 'Error',
'Error...': 'Erreur...',
'Event': 'Evènement',
'Event category': 'Event category',
'Events': 'Evènements',
......@@ -255,6 +256,7 @@
'Percentage': 'Pourcentage',
'Period': 'Période',
'Period End': 'Period End',
'Period is not defined.': "Sélectionnez une période.",
'Period Start': 'Period Start',
'Person': 'Persone',
'Persone': 'Persone',
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment