Skip to content

Commit

Permalink
Merge pull request #72 from edly-io/feat/add-partner-based-filtering
Browse files Browse the repository at this point in the history
Add partner based filtering in elasticsearch apis
  • Loading branch information
hinakhadim authored Nov 2, 2023
2 parents c72b66f + fe457d8 commit db9118c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -100,5 +100,4 @@ class DataLoaderCourseRunSearchViewSet(CourseRunSearchViewSet):
'number': 'number',
'org': {'field': 'org.raw', 'lookups': [LOOKUP_FILTER_TERM, LOOKUP_FILTER_TERMS]},
'category': {'field': 'subjects.raw', 'lookups': [LOOKUP_FILTER_TERM, LOOKUP_FILTER_TERMS, LOOKUP_QUERY_IN]},

}
Original file line number Diff line number Diff line change
Expand Up @@ -122,3 +122,8 @@ def filter_facet_queryset(self, queryset):
queryset = queryset.filter('term', published=True).exclude('term', hidden=True)

return queryset

def get_queryset(self):
queryset = super().get_queryset()
queryset = queryset.filter('term', partner=self.request.site.partner.short_code)
return queryset

0 comments on commit db9118c

Please sign in to comment.