Skip to content

Commit ad4a117

Browse files
author
Ricardo Cañuelo
committed
api: more traces in the PUT nodes path
Signed-off-by: Ricardo Cañuelo <[email protected]>
1 parent 0aeb860 commit ad4a117

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

api/db.py

+3
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,8 @@ async def create(self, obj):
165165
async def _create_recursively(self, hierarchy: Hierarchy, parent: Node,
166166
cls, col):
167167
obj = parse_node_obj(hierarchy.node)
168+
print(f"[_create_recursively] obj: {obj}")
169+
print(f"[_create_recursively] obj.data: {obj.data}")
168170
if parent:
169171
obj.parent = parent.id
170172
if obj.id:
@@ -179,6 +181,7 @@ async def _create_recursively(self, hierarchy: Hierarchy, parent: Node,
179181
res = await col.insert_one(obj.dict(by_alias=True))
180182
obj.id = res.inserted_id
181183
obj = cls(**await col.find_one(ObjectId(obj.id)))
184+
print(f"[_create_recursively] stored obj: {obj}")
182185
obj_list = [obj]
183186
for node in hierarchy.child_nodes:
184187
child_nodes = await self._create_recursively(node, obj, cls, col)

api/main.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -621,9 +621,10 @@ async def put_nodes(
621621
"""Add a hierarchy of nodes to an existing root node"""
622622
nodes.node.id = ObjectId(node_id)
623623
await _set_node_ownership_recursively(user, nodes)
624-
obj_list = await db.create_hierarchy(nodes, Node)
625624
print(f"[PUT nodes/{node_id}] hierarchy: {nodes}")
625+
obj_list = await db.create_hierarchy(nodes, Node)
626626
data = _get_node_event_data('updated', obj_list[0])
627+
print(f"[PUT nodes/{node_id}] updated node event data: {data}")
627628
attributes = {}
628629
if data.get('owner', None):
629630
attributes['owner'] = data['owner']

0 commit comments

Comments
 (0)