Commit 48752864 authored by Yoshinori Okuji's avatar Yoshinori Okuji

Check if each axis is empty.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@807 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent ebb10b27
...@@ -626,6 +626,18 @@ class XMLMatrix(Folder): ...@@ -626,6 +626,18 @@ class XMLMatrix(Folder):
if object.id not in to_delete: if object.id not in to_delete:
to_delete += [object.id] to_delete += [object.id]
else: else:
# Check empty indices.
empty_list = []
for i in self.index[base_id].keys():
if self.index[base_id][i] is None or len(self.index[base_id][i]) == 0:
error_message = "There is no id for the %dth axis of base_id %s" % (i, base_id)
if fixit: error_message += ' (fixed)'
errors += [(self.getRelativeUrl(), 'XMLMatrix inconsistency',102,error_message)]
empty_list.append(i)
if fixit:
for i in empty_list:
del self.index[base_id][i]
len_id = len(self.index[base_id]) len_id = len(self.index[base_id])
if len(object_id_split) != (len_id + base_id_len): # +1 for the quantity if len(object_id_split) != (len_id + base_id_len): # +1 for the quantity
error_message = "Dimension of cell is %s but should be %s" % (len(object_id_split) error_message = "Dimension of cell is %s but should be %s" % (len(object_id_split)
......
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