Fix crash introduced by previous cset 7b01294f336d
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Mon, 04 Jan 2016 11:21:30 +0100
changeset 790 30e5ba809a03
parent 789 7b01294f336d
child 791 829796293f62
Fix crash introduced by previous cset 7b01294f336d when types are actually yams schema instead of bare string, one ended up with: File "/usr/lib/python2.7/dist-packages/rql/nodes.py", line 639, in get_type if lhstype == rhstype and not 'Date' in lhstype: TypeError: argument of type 'CubicWebEntitySchema' is not iterable
rql/nodes.py
--- a/rql/nodes.py	Tue Dec 22 12:16:23 2015 +0100
+++ b/rql/nodes.py	Mon Jan 04 11:21:30 2016 +0100
@@ -636,7 +636,7 @@
                     ('+', 'TZDatetime', 'Interval'): 'TZDatetime',
                     }[key]
         except KeyError:
-            if lhstype == rhstype and not 'Date' in lhstype:
+            if lhstype == rhstype and 'Date' not in str(lhstype):
                 return rhstype
             if sorted((lhstype, rhstype)) == ['Float', 'Int']:
                 return 'Float'