Commit 4f5de7e0 authored by Alexandre Boeglin's avatar Alexandre Boeglin

allows importing templates when the catalog method filter does not use an

Expression


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@10151 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent d4b83fa7
...@@ -1245,7 +1245,7 @@ class PortalTypeWorkflowChainTemplateItem(BaseTemplateItem): ...@@ -1245,7 +1245,7 @@ class PortalTypeWorkflowChainTemplateItem(BaseTemplateItem):
workflow_name = workflow[1:] workflow_name = workflow[1:]
else: else:
workflow_name = workflow workflow_name = workflow
if workflow[0]!= '-' and \ if workflow[0] != '-' and \
workflow_name not in chain_dict['chain_%s' % portal_type]: workflow_name not in chain_dict['chain_%s' % portal_type]:
raise NotFound, 'workflow %s not found in chain for portal_type %s'\ raise NotFound, 'workflow %s not found in chain for portal_type %s'\
% (workflow, portal_type) % (workflow, portal_type)
...@@ -1815,7 +1815,10 @@ class CatalogMethodTemplateItem(ObjectTemplateItem): ...@@ -1815,7 +1815,10 @@ class CatalogMethodTemplateItem(ObjectTemplateItem):
key = method.getAttribute('key') key = method.getAttribute('key')
key_type = str(method.getAttribute('type')) key_type = str(method.getAttribute('type'))
if key_type == "str": if key_type == "str":
value = str(method.getElementsByTagName('value')[0].childNodes[0].data) if len(method.getElementsByTagName('value')[0].childNodes):
value = str(method.getElementsByTagName('value')[0].childNodes[0].data)
else:
value = ''
key = str(key) key = str(key)
elif key_type == "int": elif key_type == "int":
value = int(method.getElementsByTagName('value')[0].childNodes[0].data) value = int(method.getElementsByTagName('value')[0].childNodes[0].data)
......
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