Skip to content

Commit 94c174a

Browse files
committed
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 <denys.f@collabora.com>
1 parent 4c30c3f commit 94c174a

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

api/main.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -797,12 +797,9 @@ async def put_batch_nodeset(data: NodeUpdateRequest,
797797
status_code=status.HTTP_404_NOT_FOUND,
798798
detail=f"Node not found with id: {node_id}"
799799
)
800-
# verify ownership
800+
# verify ownership, and ignore if not owner
801801
if not user.username == node_from_id.owner:
802-
raise HTTPException(
803-
status_code=status.HTTP_401_UNAUTHORIZED,
804-
detail="Unauthorized to complete the operation"
805-
)
802+
continue
806803
# right now we support only field:
807804
# processed_by_kcidb_bridge, also value should be boolean
808805
if field == 'processed_by_kcidb_bridge':

0 commit comments

Comments
 (0)