Refactor flow retrieval logic in read_flows function
This commit is contained in:
parent
f44776934d
commit
4286b6a93e
1 changed files with 5 additions and 1 deletions
|
|
@ -57,7 +57,11 @@ def read_flows(
|
||||||
try:
|
try:
|
||||||
auth_settings = settings_service.auth_settings
|
auth_settings = settings_service.auth_settings
|
||||||
if auth_settings.AUTO_LOGIN:
|
if auth_settings.AUTO_LOGIN:
|
||||||
flows = session.exec(select(Flow).where(Flow.user_id == None | Flow.user_id == current_user.id)).all() # noqa
|
flows = session.exec(
|
||||||
|
select(Flow).where(
|
||||||
|
(Flow.user_id == None) | (Flow.user_id == current_user.id)
|
||||||
|
)
|
||||||
|
).all() # noqa
|
||||||
else:
|
else:
|
||||||
flows = current_user.flows
|
flows = current_user.flows
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue