Skip to content

Commit

Permalink
bugfix: filter flows on folder to ensure is displaying only for the l…
Browse files Browse the repository at this point in the history
…ogged user (#2897)

* 🐛 (generalBugs-shard-5.spec.ts): fix test to wait for elements to be interactable before performing actions to prevent flakiness

* 🐛 (folders.py): fix issue where all flows were being returned instead of only flows from the current user in the specified folder
  • Loading branch information
Cristhianzl committed Jul 23, 2024
1 parent b7bc36d commit 7ffcdd2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/backend/base/langflow/api/v1/folders.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ def read_folder(
folder = session.exec(select(Folder).where(Folder.id == folder_id, Folder.user_id == current_user.id)).first()
if not folder:
raise HTTPException(status_code=404, detail="Folder not found")
flows_from_current_user_in_folder = [flow for flow in folder.flows if flow.user_id == current_user.id]
folder.flows = flows_from_current_user_in_folder
return folder
except Exception as e:
if "No result found" in str(e):
Expand Down

0 comments on commit 7ffcdd2

Please sign in to comment.