Commit 6d5c79d2 authored by Nicolas Delaby's avatar Nicolas Delaby

Use more defensive code for discoverable features.

Ingestion must suceeds whatever encountered issues.

Done by JPS


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@41703 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent d38692f1
......@@ -66,7 +66,9 @@ class DiscoverableMixin(CachedConvertableMixin):
user_login = str(getSecurityManager().getUser())
method = self._getTypeBasedMethod('getPropertyDictFromUserLogin',
fallback_script_id='Document_getPropertyDictFromUserLogin')
return method(user_login)
if method is not None:
return method(user_login)
return {}
security.declareProtected(Permissions.AccessContentsInformation,
'getPropertyDictFromContent')
......@@ -82,7 +84,9 @@ class DiscoverableMixin(CachedConvertableMixin):
return {}
method = self._getTypeBasedMethod('getPropertyDictFromContent',
fallback_script_id='Document_getPropertyDictFromContent')
return method()
if method is not None:
return method()
return {}
security.declareProtected(Permissions.AccessContentsInformation,
'getPropertyDictFromFilename')
......@@ -106,7 +110,9 @@ class DiscoverableMixin(CachedConvertableMixin):
to getPropertyDictFromInput.
"""
method = self._getTypeBasedMethod('getPropertyDictFromInput')
return method(input_parameter_dict)
if method is not None:
return method(input_parameter_dict)
return {}
### Metadata disovery and ingestion methods
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