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 ...@@ -8,7 +8,7 @@ import re
from plugin_dbui import INLINE_ALERT from plugin_dbui import INLINE_ALERT
from report_objects import do_title, Graph, List, Metric1D, Metric2D from report_objects import do_title, Graph, List, Metric1D, Metric2D
from selector import MySelector from selector import MySelector, SelectorActiveItemsException
def graph_extjs(): def graph_extjs():
...@@ -47,8 +47,13 @@ def graph_mpl(): ...@@ -47,8 +47,13 @@ def graph_mpl():
""" """
# selector and configuration # selector and configuration
ui_table = virtdb.graph_selector try:
selector = MySelector(ui_table) 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] config = db.graphs[request.vars.id_graphs]
# build the graph # build the graph
...@@ -80,9 +85,13 @@ def grid(): ...@@ -80,9 +85,13 @@ def grid():
The identifier is used to instantiate the proper class. The identifier is used to instantiate the proper class.
""" """
ui_table = virtdb.grid_selector try:
selector = MySelector(ui_table) 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 # extract the report configuration and the build the report
try: try:
if "id_lists" in request.vars: if "id_lists" in request.vars:
......
...@@ -102,6 +102,7 @@ ...@@ -102,6 +102,7 @@
'enter an integer between %(min)g and %(max)g': 'enter an integer between %(min)g and %(max)g', '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', 'enter date as %(format)s': 'enter date as %(format)s',
'Error': 'Error', 'Error': 'Error',
'Error...': 'Erreur...',
'Event': 'Evènement', 'Event': 'Evènement',
'Event category': 'Event category', 'Event category': 'Event category',
'Events': 'Evènements', 'Events': 'Evènements',
...@@ -255,6 +256,7 @@ ...@@ -255,6 +256,7 @@
'Percentage': 'Pourcentage', 'Percentage': 'Pourcentage',
'Period': 'Période', 'Period': 'Période',
'Period End': 'Period End', 'Period End': 'Period End',
'Period is not defined.': "Sélectionnez une période.",
'Period Start': 'Period Start', 'Period Start': 'Period Start',
'Person': 'Persone', 'Person': 'Persone',
'Persone': '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