Skip to content

Commit

Permalink
fix(main.py): Improve bulk-set robustness
Browse files Browse the repository at this point in the history
Do not fail if one of nodes have wrong ownership, just
ignore this node.

Signed-off-by: Denys Fedoryshchenko <[email protected]>
  • Loading branch information
nuclearcat committed Dec 5, 2024
1 parent 4c30c3f commit caf67d9
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions api/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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':
Expand Down

0 comments on commit caf67d9

Please sign in to comment.