Fixed bug in parsing jstree
A projection was missing, causing warnings that the node doesn't have a content type.
This commit is contained in:
parent
054eced7de
commit
8f9d21cdd8
@ -115,15 +115,17 @@ def jstree_build_from_node(node):
|
|||||||
|
|
||||||
# Get the parent node
|
# Get the parent node
|
||||||
parent = None
|
parent = None
|
||||||
|
parent_projection = {'projection': {
|
||||||
|
'name': 1,
|
||||||
|
'parent': 1,
|
||||||
|
'project': 1,
|
||||||
|
'node_type': 1,
|
||||||
|
'properties.content_type': 1,
|
||||||
|
}}
|
||||||
|
|
||||||
if node.parent:
|
if node.parent:
|
||||||
try:
|
try:
|
||||||
parent = Node.find(node.parent, {
|
parent = Node.find(node.parent, parent_projection, api=api)
|
||||||
'projection': {
|
|
||||||
'name': 1,
|
|
||||||
'node_type': 1,
|
|
||||||
'parent': 1,
|
|
||||||
'properties.content_type': 1,
|
|
||||||
}}, api=api)
|
|
||||||
# Define the child node of the tree (usually an asset)
|
# Define the child node of the tree (usually an asset)
|
||||||
except ResourceNotFound:
|
except ResourceNotFound:
|
||||||
# If not found, we might be on the top level, in which case we skip the
|
# If not found, we might be on the top level, in which case we skip the
|
||||||
@ -147,10 +149,7 @@ def jstree_build_from_node(node):
|
|||||||
# If we have a parent
|
# If we have a parent
|
||||||
if parent.parent:
|
if parent.parent:
|
||||||
try:
|
try:
|
||||||
parent = Node.find(parent.parent, {
|
parent = Node.find(parent.parent, parent_projection, api=api)
|
||||||
'projection': {
|
|
||||||
'name': 1, 'parent': 1, 'project': 1, 'node_type': 1},
|
|
||||||
}, api=api)
|
|
||||||
except ResourceNotFound:
|
except ResourceNotFound:
|
||||||
parent = None
|
parent = None
|
||||||
else:
|
else:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user