Skip to content

Commit

Permalink
fix query
Browse files Browse the repository at this point in the history
  • Loading branch information
Tansito committed Dec 20, 2024
1 parent 1fb6ba9 commit 1869aca
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion gateway/api/repositories/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,11 @@ def get_provider_functions_with_run_permissions(self, author) -> List[Function]:
)
author_groups_with_run_permissions_criteria = Q(instances__in=run_groups)
provider_exists_criteria = ~Q(provider=None)
author_criteria = Q(author=author)

result_queryset = Function.objects.filter(
author_groups_with_run_permissions_criteria & provider_exists_criteria
(author_groups_with_run_permissions_criteria & provider_exists_criteria)
| (author_criteria & provider_exists_criteria)
).distinct()

count = result_queryset.count()
Expand Down

0 comments on commit 1869aca

Please sign in to comment.