Skip to content

Commit

Permalink
OpenConceptLab/ocl_issues#1710 | facets exlusions for global scope
Browse files Browse the repository at this point in the history
  • Loading branch information
snyaggarwal committed Dec 12, 2023
1 parent 6ce54d9 commit 0fdee2d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions core/common/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -424,8 +424,12 @@ def get_facets(self):
facets.pop('updatedBy', None)
if self.should_search_latest_repo() and self.is_source_child_document_model() and 'source_version' in facets:
facets['source_version'] = [facet for facet in facets['source_version'] if facet[0] != 'HEAD']
if 'source' not in self.kwargs and 'source_version' in facets:
facets.pop('source_version')
is_global_scope = ('org' not in self.kwargs and 'user' not in self.kwargs and not self.user_is_self)
if is_global_scope:
facets.pop('source_version', None)
facets.pop('collection_version', None)
facets.pop('expansion', None)
facets.pop('collection_owner_url', None)
return facets

def get_extras_searchable_fields_from_query_params(self):
Expand Down

0 comments on commit 0fdee2d

Please sign in to comment.