Commit 46abf781 authored by Julien Muchembled's avatar Julien Muchembled

Contribution Tool: fallback to Embedded File only if necessary

parent af695afa
...@@ -197,11 +197,11 @@ class ContributionTool(BaseTool): ...@@ -197,11 +197,11 @@ class ContributionTool(BaseTool):
portal_type = kw.pop('portal_type', None) portal_type = kw.pop('portal_type', None)
if not portal_type: if not portal_type:
if container is None or container.isModuleType():
# Guess it with help of portal_contribution_registry # Guess it with help of portal_contribution_registry
portal_type = portal.portal_contribution_registry.findPortalTypeName( portal_type = portal.portal_contribution_registry.findPortalTypeName(
filename=filename, content_type=content_type) filename=filename, content_type=content_type)
else: if not (container is None or container.isModuleType() or
container.getTypeInfo().allowType(portal_type)):
portal_type = 'Embedded File' portal_type = 'Embedded File'
if container is not None: if container is not None:
......
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