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