Add example flows to user flows

This commit is contained in:
Gabriel Luiz Freitas Almeida 2024-03-06 14:21:22 -03:00
commit 8695d90583

View file

@ -62,6 +62,7 @@ def read_flows(
flows = current_user.flows flows = current_user.flows
flows = validate_is_component(flows) flows = validate_is_component(flows)
flow_ids = [flow.id for flow in 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(
@ -70,7 +71,7 @@ def read_flows(
) )
).all() # noqa ).all() # noqa
for example_flow in example_flows: for example_flow in example_flows:
if example_flow not in flows: if example_flow.id not in flow_ids:
flows.append(example_flow) flows.append(example_flow)
except Exception as e: except Exception as e:
logger.error(e) logger.error(e)