diff --git a/product/ERP5/mixin/discoverable.py b/product/ERP5/mixin/discoverable.py index 6ffd6d2641695b2cde6caf1ada6339d7292c95de..e142a8afa385b0707162f965d7cef6e30cc7f346 100644 --- a/product/ERP5/mixin/discoverable.py +++ b/product/ERP5/mixin/discoverable.py @@ -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,