Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
course-discovery
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
course-discovery
Commits
d9962e57
Commit
d9962e57
authored
Oct 27, 2017
by
asadiqbal
Committed by
Douglas Hall
Oct 30, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add Program.is_program_eligible_for_one_click_purchase to discovery service search index
parent
9690b167
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
1 deletions
+5
-1
course_discovery/apps/api/serializers.py
+1
-1
course_discovery/apps/api/tests/test_serializers.py
+1
-0
course_discovery/apps/course_metadata/search_indexes.py
+3
-0
No files found.
course_discovery/apps/api/serializers.py
View file @
d9962e57
...
...
@@ -73,7 +73,7 @@ BASE_PROGRAM_FIELDS = (
PROGRAM_SEARCH_FIELDS
=
BASE_PROGRAM_FIELDS
+
(
'aggregation_key'
,
'authoring_organizations'
,
'authoring_organization_uuids'
,
'subject_uuids'
,
'staff_uuids'
,
'weeks_to_complete_min'
,
'weeks_to_complete_max'
,
'min_hours_effort_per_week'
,
'max_hours_effort_per_week'
,
'hidden'
,
'hidden'
,
'is_program_eligible_for_one_click_purchase'
,
)
PROGRAM_FACET_FIELDS
=
BASE_PROGRAM_FIELDS
+
(
'organizations'
,)
...
...
course_discovery/apps/api/tests/test_serializers.py
View file @
d9962e57
...
...
@@ -1294,6 +1294,7 @@ class TestProgramSearchSerializer:
'max_hours_effort_per_week'
:
program
.
max_hours_effort_per_week
,
'language'
:
[
serialize_language
(
language
)
for
language
in
program
.
languages
],
'hidden'
:
program
.
hidden
,
'is_program_eligible_for_one_click_purchase'
:
program
.
is_program_eligible_for_one_click_purchase
}
def
test_data
(
self
):
...
...
course_discovery/apps/course_metadata/search_indexes.py
View file @
d9962e57
...
...
@@ -243,6 +243,9 @@ class ProgramIndex(BaseIndex, indexes.Indexable, OrganizationsMixin):
weeks_to_complete_max
=
indexes
.
IntegerField
(
model_attr
=
'weeks_to_complete_max'
,
null
=
True
)
language
=
indexes
.
MultiValueField
(
faceted
=
True
)
hidden
=
indexes
.
BooleanField
(
model_attr
=
'hidden'
,
faceted
=
True
)
is_program_eligible_for_one_click_purchase
=
indexes
.
BooleanField
(
model_attr
=
'is_program_eligible_for_one_click_purchase'
,
null
=
False
)
def
prepare_aggregation_key
(
self
,
obj
):
return
'program:{}'
.
format
(
obj
.
uuid
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment