Commit 9214ab1d authored by Jérome Perrin's avatar Jérome Perrin

product/ERP5Type/mixin/matrix: python3 compatibility

parent 9207eaab
...@@ -320,7 +320,7 @@ class Matrix(object): ...@@ -320,7 +320,7 @@ class Matrix(object):
cell_range = aq_base(self).index[base_id] cell_range = aq_base(self).index[base_id]
except (AttributeError, KeyError): except (AttributeError, KeyError):
return [] return []
return [x.keys() for _, x in sorted(six.iteritems(cell_range))] return [ensure_list(x.keys()) for _, x in sorted(six.iteritems(cell_range))]
security.declareProtected( Permissions.ModifyPortalContent, 'newCell' ) security.declareProtected( Permissions.ModifyPortalContent, 'newCell' )
def newCell(self, *kw, **kwd): def newCell(self, *kw, **kwd):
...@@ -449,7 +449,7 @@ class Matrix(object): ...@@ -449,7 +449,7 @@ class Matrix(object):
""" """
if getattr(aq_base(self), 'index', None) is None: if getattr(aq_base(self), 'index', None) is None:
return () return ()
return self.index.keys() return ensure_list(self.index.keys())
security.declareProtected( Permissions.ModifyPortalContent, 'delMatrix' ) security.declareProtected( Permissions.ModifyPortalContent, 'delMatrix' )
def delMatrix(self, base_id = 'cell'): def delMatrix(self, base_id = 'cell'):
......
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