Commit c98252c0 authored by Denis Laxalde's avatar Denis Laxalde
Browse files

Return None, None in parent_and_container() instead of crashing

Still log the information, just in case...
parent 928947277217
......@@ -42,7 +42,10 @@ def parent_and_container(entity):
parent = entity.cw_adapt_to('IContained').parent
if container is None:
# entity may be both container and contained, and in this case is a container
assert entity.cw_adapt_to('IContainer'), entity
if entity.cw_adapt_to('IContainer') is None:
entity.debug('cannot adapt %s as IContainer in parent_and_container()',
entity)
return None, None
container = entity
else:
req = entity._cw
......
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