Skip to content

Commit

Permalink
fix: check for * before filtering
Browse files Browse the repository at this point in the history
  • Loading branch information
iloveagent57 committed Feb 23, 2024
1 parent 74afde6 commit 39b1d6c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions enterprise_access/apps/api/filters/subsidy_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ def filter_queryset(self, request, queryset, view):
request, [constants.REQUESTS_LEARNER_ROLE]
)

# do a similar check for edge-case learners that might have access to all enterprises
if constants.ALL_ACCESS_CONTEXT in accessible_enterprises_as_learner:
return queryset

return queryset.filter(
Q(enterprise_customer_uuid__in=accessible_enterprises_as_admin.union(accessible_enterprises_as_learner))
)

0 comments on commit 39b1d6c

Please sign in to comment.