Commit f8179b18 authored by Lucas Carvalho's avatar Lucas Carvalho

Script variable can be None. So it was not raising well. Now is possible to...

Script variable can be None. So it was not raising well. Now is possible to see which Portal Type does not have cell range script.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@34433 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 6cc7f587
......@@ -308,12 +308,11 @@ class XMLMatrix(Folder):
asCellRange scripts should be unified if possible
"""
script = self._getTypeBasedMethod('asCellRange', **kw)
try:
cell_range = script(base_id=base_id, matrixbox=0, **kw)
except UnboundLocalError:
if script is None:
raise UnboundLocalError,\
"Did not find cell range script for portal type: %r" %\
self.getPortalType()
"Did not find cell range script for portal type: %r" %\
self.getPortalType()
cell_range = script(base_id=base_id, matrixbox=0, **kw)
self._setCellRange(base_id=base_id, *cell_range)
security.declareProtected(Permissions.ModifyPortalContent,
......
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