Library delete 409s on published usages as well as draft ones

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WgBfkm4rCmtd1T4vHWjEPx
This commit is contained in:
2026-10-15 10:05:21 +02:00
co-authored by Claude Opus 5.5
parent 5a5f4c5a80
commit 0da9a65eac
2 changed files with 34 additions and 1 deletions
+4 -1
View File
@@ -353,7 +353,10 @@ async def delete_shared_node(
for flow in sorted({usage.split(".", 1)[0] for usage in running}):
await controller.reload_flow(flow)
return Message(message=f"Deleted shared node '{lib_name}'")
used_by = controller.store.usages(lib_name)
# The published flows too: a draft that unshared a node still runs it.
used_by = sorted(
{*controller.store.usages(lib_name), *controller.store.usages(lib_name, False)}
)
if used_by:
raise HTTPException(
status_code=409,