From caf67d939398bb7cdf1e8f948f57ca8fa5b22b39 Mon Sep 17 00:00:00 2001 From: Denys Fedoryshchenko Date: Thu, 5 Dec 2024 19:26:57 +0200 Subject: [PATCH] fix(main.py): Improve bulk-set robustness Do not fail if one of nodes have wrong ownership, just ignore this node. Signed-off-by: Denys Fedoryshchenko --- api/main.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/api/main.py b/api/main.py index 781dc23d..fc56aadf 100644 --- a/api/main.py +++ b/api/main.py @@ -797,12 +797,9 @@ async def put_batch_nodeset(data: NodeUpdateRequest, status_code=status.HTTP_404_NOT_FOUND, detail=f"Node not found with id: {node_id}" ) - # verify ownership + # verify ownership, and ignore if not owner if not user.username == node_from_id.owner: - raise HTTPException( - status_code=status.HTTP_401_UNAUTHORIZED, - detail="Unauthorized to complete the operation" - ) + continue # right now we support only field: # processed_by_kcidb_bridge, also value should be boolean if field == 'processed_by_kcidb_bridge':