Skip to content

Commit

Permalink
fix: only index active programs
Browse files Browse the repository at this point in the history
  • Loading branch information
johnnagro committed Oct 12, 2023
1 parent 63102f5 commit b022958
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion enterprise_catalog/apps/catalog/algolia_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,8 @@ def _should_index_program(program_metadata):

return program_json_metadata.get('marketing_url')\
and program_json_metadata.get('type')\
and not program_json_metadata.get('hidden')
and not program_json_metadata.get('hidden')\
and program_json_metadata.get('status') == 'active'


def partition_program_keys_for_indexing(programs_content_metadata):
Expand Down
1 change: 1 addition & 0 deletions enterprise_catalog/apps/catalog/tests/factories.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ def json_metadata(self):
'marketing_url': f'https://marketing.url/{self.content_key}',
'authoring_organizations': authoring_organizations,
'card_image_url': self.card_image_url,
'status': 'active',
})
elif self.content_type == LEARNER_PATHWAY:
json_metadata.update({
Expand Down

0 comments on commit b022958

Please sign in to comment.