Skip to content

Commit

Permalink
Ensure flows always have a folder (#1980)
Browse files Browse the repository at this point in the history
* chore: update settings attributes and remove config.yaml references

* Remove config.yaml references and update settings attributes

* chore: Ensure flows always have a folder

* chore: Update store attribute in check_if_store_is_enabled function
  • Loading branch information
ogabrielluiz authored May 27, 2024
1 parent 9d5d40f commit 011915d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/backend/base/langflow/api/v1/flows.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ def create_flow(
db_flow.updated_at = datetime.now(timezone.utc)

if db_flow.folder_id is None:
default_folder = session.exec(select(Folder).where(Folder.name == DEFAULT_FOLDER_NAME)).first()
# Make sure flows always have a folder
default_folder = session.exec(
select(Folder).where(Folder.name == DEFAULT_FOLDER_NAME, Folder.user_id == current_user.id)
).first()
if default_folder:
db_flow.folder_id = default_folder.id

Expand Down
2 changes: 1 addition & 1 deletion src/backend/base/langflow/api/v1/store.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def check_if_store_is_enabled(
settings_service=Depends(get_settings_service),
):
return {
"enabled": settings_service.settings.STORE,
"enabled": settings_service.settings.store,
}


Expand Down

0 comments on commit 011915d

Please sign in to comment.