Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
cubicweb
cubes
seda
Commits
e9dd2397f4ef
Commit
c98252c0
authored
Apr 24, 2019
by
Denis Laxalde
Browse files
Return None, None in parent_and_container() instead of crashing
Still log the information, just in case...
parent
928947277217
Changes
1
Hide whitespace changes
Inline
Side-by-side
cubicweb_seda/entities/__init__.py
View file @
e9dd2397
...
...
@@ -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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment