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

Contribution Tool: fallback to Embedded File only if necessary

parent af695afa
...@@ -197,12 +197,12 @@ class ContributionTool(BaseTool): ...@@ -197,12 +197,12 @@ 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) if not (container is None or container.isModuleType() or
else: container.getTypeInfo().allowType(portal_type)):
portal_type = 'Embedded File' portal_type = 'Embedded File'
if container is not None: if container is not None:
# Simplify things here and return a document immediately # Simplify things here and return a document immediately
......
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