Add STARTER_FOLDER_NAME filter to read_flows function
This commit is contained in:
parent
91a98ae877
commit
308c27c381
1 changed files with 4 additions and 1 deletions
|
|
@ -10,6 +10,7 @@ from sqlmodel import Session, select
|
||||||
|
|
||||||
from langflow.api.utils import remove_api_keys, validate_is_component
|
from langflow.api.utils import remove_api_keys, validate_is_component
|
||||||
from langflow.api.v1.schemas import FlowListCreate, FlowListRead
|
from langflow.api.v1.schemas import FlowListCreate, FlowListRead
|
||||||
|
from langflow.initial_setup.setup import STARTER_FOLDER_NAME
|
||||||
from langflow.services.auth.utils import get_current_active_user
|
from langflow.services.auth.utils import get_current_active_user
|
||||||
from langflow.services.database.models.flow import (
|
from langflow.services.database.models.flow import (
|
||||||
Flow,
|
Flow,
|
||||||
|
|
@ -57,7 +58,9 @@ def read_flows(
|
||||||
# with the session get the flows that DO NOT have a user_id
|
# with the session get the flows that DO NOT have a user_id
|
||||||
try:
|
try:
|
||||||
example_flows = session.exec(
|
example_flows = session.exec(
|
||||||
select(Flow).where(Flow.user_id == None)
|
select(Flow).where(
|
||||||
|
Flow.user_id == None, Flow.folder == STARTER_FOLDER_NAME
|
||||||
|
)
|
||||||
).all() # noqa
|
).all() # noqa
|
||||||
flows.extend(example_flows)
|
flows.extend(example_flows)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue