[views] test presence of jqplot before using it (closes #2345646) stable
authorDavid Douard <david.douard@logilab.fr>
Fri, 05 Apr 2013 17:14:52 +0200
branchstable
changeset 881 4b6f0f1c6775
parent 880 14cfe77807c7
child 882 795f7976f9b2
[views] test presence of jqplot before using it (closes #2345646)
views/primary.py
views/tracker.py
--- a/views/primary.py	Tue Mar 12 19:11:17 2013 +0100
+++ b/views/primary.py	Fri Apr 05 17:14:52 2013 +0200
@@ -135,9 +135,10 @@
     html_headers = no_robot_index
 
     def entity_call(self, entity):
-        project_rset = self._cw.execute('Any P WHERE P has_apycot_environment TC, TC eid %(e)s',
-                                        {'e': entity.eid})
-        self.wview('projectgraphtestresults', project_rset, 'null')
+        if 'jqplot' in self._cw.vreg.config.cubes():
+            project_rset = self._cw.execute('Any P WHERE P has_apycot_environment TC, TC eid %(e)s',
+                                            {'e': entity.eid})
+            self.wview('projectgraphtestresults', project_rset, 'null')
         rset = self._cw.execute(
             'Any T,TC,T,TB,TST,TET,TF, TS ORDERBY TST DESC WHERE '
             'T status TS, T using_config TC, T branch TB, '
--- a/views/tracker.py	Tue Mar 12 19:11:17 2013 +0100
+++ b/views/tracker.py	Fri Apr 05 17:14:52 2013 +0200
@@ -99,7 +99,8 @@
     __select__ = is_instance('Project')
 
     def entity_call(self, entity):
-        self.wview('projectgraphtestresults', self.cw_rset, 'null')
+        if 'jqplot' in self._cw.vreg.config.cubes():
+            self.wview('projectgraphtestresults', self.cw_rset, 'null')
         rset = self._cw.execute(
             'Any T,TC,T,TB,TST,TET,TF, TS ORDERBY TST DESC WHERE '
             'T status TS, T using_config TC, T branch TB, '