[xcede] Add safety belt on xcede view for empty measure rset
authorVincent Michel <vincent.michel@logilab.fr>
Wed, 03 Jul 2013 16:00:35 +0200
changeset 153 d79a9d8c14f3
parent 38 208aa483385c
child 154 63acf059a3fe
[xcede] Add safety belt on xcede view for empty measure rset
views/xcede.py
--- a/views/xcede.py	Fri Jan 25 09:01:55 2013 +0100
+++ b/views/xcede.py	Wed Jul 03 16:00:35 2013 +0200
@@ -63,9 +63,9 @@
         # Scans, Questionnaires
         # XXX Only use it for now if we have less than 10 subjects - time consuming
         if len(self.cw_rset) < 10:
-            for measure in ('Scan', 'QuestionnaireRun', 'GenomicMeasure'):
-                rset = self._cw.execute('Any M WHERE M concerns S, M is %s, S eid %%(e)s' % measure,
-                                        {'e': entity.eid})
+            rset = self._cw.execute('Any M WHERE M concerns S, S eid %(e)s, '
+                                    'M is IN (Scan, QuestionnaireRun, GenomicMeasure)', {'e': entity.eid})
+            if rset:
                 self.wview('xcede-item', rset)