[py3] Fix comparison of cardinality when maxvalue is graph_nodes.INFINITY
authorDenis Laxalde <denis.laxalde@logilab.fr>
Fri, 04 Oct 2019 11:07:10 +0200
changeset 3056 ca793a3a1ac5
parent 3055 c1bdaadb783c
child 3057 6799f1c605a0
[py3] Fix comparison of cardinality when maxvalue is graph_nodes.INFINITY See also 1dd2faa2de16.
cubicweb_seda/entities/profile_generation.py
--- a/cubicweb_seda/entities/profile_generation.py	Fri Oct 04 10:54:15 2019 +0200
+++ b/cubicweb_seda/entities/profile_generation.py	Fri Oct 04 11:07:10 2019 +0200
@@ -133,7 +133,7 @@
             continue
         minc, maxc = minmax_cardinality(parent_cardinality)
         minvalue = min(minc, minvalue)
-        if maxc == graph_nodes.INFINITY:
+        if maxc == graph_nodes.INFINITY or maxvalue == graph_nodes.INFINITY:
             maxvalue = 'n'
         else:
             maxvalue = max(maxc, maxvalue)