Commit b3a56ca3 authored by Ivan Tyagov's avatar Ivan Tyagov

Minor fixes

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@14128 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 38f073f4
......@@ -328,19 +328,15 @@ class ContributionTool(BaseTool):
method = self._getTypeBasedMethod('getPropertyDictFromFileName',
fallback_script_id = 'ContributionTool_getPropertyDictFromFileName')
property_dict = method(file_name, property_dict)
if property_dict.has_key('portal_type') and property_dict['portal_type']:
if property_dict.get('portal_type', None) is not None:
# we have to return portal_type as a tuple
# because we should allow for having multiple candidate types
property_dict['portal_type'] = (property_dict['portal_type'],)
else:
# we have to find candidates by file extenstion
try:
index = file_name.rfind('.')
if index != -1:
ext = file_name[index+1:]
if file_name.rfind('.')!= -1:
ext = file_name.split('.')[-1]
property_dict['portal_type'] = self.ContributionTool_getCandidateTypeListByExtension(ext)
except ValueError: # no dot in file name
pass
return property_dict
# WebDAV virtual folder support
......
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