Skip to content

Commit

Permalink
multitenant default filter fix (#1878)
Browse files Browse the repository at this point in the history
  • Loading branch information
auslin-aot authored Feb 5, 2024
1 parent 8a692f3 commit cd3d227
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion forms-flow-api/src/formsflow_api/services/filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,13 @@ def get_user_filters(**kwargs):
if current_app.config.get("MULTI_TENANCY_ENABLED"):
all_filters = Filter.find_all_filters()
all_tasks_filter = any(
(item.name.lower() == "all tasks" and item.status == "active")
(
item.name.lower() == "all tasks"
and item.status == "active"
and item.tenant is None
and (not item.roles or item.roles is None)
and (not item.users or item.users is None)
)
or (item.name.lower() == "all tasks" and item.tenant == tenant_key)
for item in all_filters
)
Expand Down

0 comments on commit cd3d227

Please sign in to comment.