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
f1f7e1ef
Commit
f1f7e1ef
authored
Oct 26, 2016
by
Matthew Piatetsky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ingest LMS hidden courses into catalog
parent
95425a3e
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
9 additions
and
2 deletions
+9
-2
course_discovery/apps/api/serializers.py
+1
-1
course_discovery/apps/api/tests/test_serializers.py
+1
-0
course_discovery/apps/course_metadata/data_loaders/api.py
+3
-1
course_discovery/apps/course_metadata/data_loaders/tests/mock_data.py
+3
-0
course_discovery/apps/course_metadata/data_loaders/tests/test_api.py
+1
-0
No files found.
course_discovery/apps/api/serializers.py
View file @
f1f7e1ef
...
...
@@ -372,7 +372,7 @@ class CourseRunSerializer(MinimalCourseRunSerializer):
fields
=
MinimalCourseRunSerializer
.
Meta
.
fields
+
(
'course'
,
'full_description'
,
'start'
,
'end'
,
'enrollment_start'
,
'enrollment_end'
,
'announcement'
,
'video'
,
'seats'
,
'content_language'
,
'transcript_languages'
,
'instructors'
,
'staff'
,
'pacing_type'
,
'min_effort'
,
'max_effort'
,
'modified'
,
'level_type'
,
'availability'
,
'mobile_available'
,
'min_effort'
,
'max_effort'
,
'modified'
,
'level_type'
,
'availability'
,
'mobile_available'
,
'hidden'
,
)
def
get_instructors
(
self
,
obj
):
# pylint: disable=unused-argument
...
...
course_discovery/apps/api/tests/test_serializers.py
View file @
f1f7e1ef
...
...
@@ -244,6 +244,7 @@ class CourseRunSerializerTests(MinimalCourseRunSerializerTests):
'video'
:
VideoSerializer
(
course_run
.
video
)
.
data
,
'pacing_type'
:
course_run
.
pacing_type
,
'mobile_available'
:
course_run
.
mobile_available
,
'hidden'
:
course_run
.
hidden
,
'content_language'
:
course_run
.
language
.
code
,
'transcript_languages'
:
[],
'min_effort'
:
course_run
.
min_effort
,
...
...
course_discovery/apps/course_metadata/data_loaders/api.py
View file @
f1f7e1ef
...
...
@@ -96,7 +96,7 @@ class CoursesApiDataLoader(AbstractDataLoader):
self
.
_process_response
(
response
)
def
_make_request
(
self
,
page
):
return
self
.
api_client
.
courses
()
.
get
(
page
=
page
,
page_size
=
self
.
PAGE_SIZE
)
return
self
.
api_client
.
courses
()
.
get
(
page
=
page
,
page_size
=
self
.
PAGE_SIZE
,
username
=
'course_discovery_worker'
)
def
_process_response
(
self
,
response
):
results
=
response
[
'results'
]
...
...
@@ -140,11 +140,13 @@ class CoursesApiDataLoader(AbstractDataLoader):
def
update_course_run
(
self
,
course
,
body
):
key
=
body
[
'id'
]
defaults
=
{
'key'
:
key
,
'end'
:
self
.
parse_date
(
body
[
'end'
]),
'enrollment_start'
:
self
.
parse_date
(
body
[
'enrollment_start'
]),
'enrollment_end'
:
self
.
parse_date
(
body
[
'enrollment_end'
]),
'hidden'
:
body
.
get
(
'hidden'
,
False
),
}
# When using a marketing site, only dates (excluding start) should come from the Course API.
...
...
course_discovery/apps/course_metadata/data_loaders/tests/mock_data.py
View file @
f1f7e1ef
...
...
@@ -39,6 +39,7 @@ COURSES_API_BODIES = [
'start'
:
'2015-06-15T13:00:00Z'
,
'pacing'
:
'self'
,
'mobile_available'
:
True
,
'hidden'
:
False
,
},
{
'effort'
:
None
,
...
...
@@ -61,6 +62,7 @@ COURSES_API_BODIES = [
'start'
:
'2015-10-29T09:00:00Z'
,
'pacing'
:
'instructor,'
,
'mobile_available'
:
False
,
'hidden'
:
False
,
},
{
# Add a second run of KyotoUx+000x (3T2016) to test merging data across
...
...
@@ -84,6 +86,7 @@ COURSES_API_BODIES = [
'short_description'
:
''
,
'start'
:
None
,
'mobile_available'
:
None
,
'hidden'
:
True
,
},
]
...
...
course_discovery/apps/course_metadata/data_loaders/tests/test_api.py
View file @
f1f7e1ef
...
...
@@ -167,6 +167,7 @@ class CoursesApiDataLoaderTests(ApiClientTestMixin, DataLoaderTestMixin, TestCas
'title_override'
:
None
,
'short_description_override'
:
None
,
'video'
:
None
,
'hidden'
:
body
.
get
(
'hidden'
,
False
),
}
if
not
partner_has_marketing_site
:
...
...
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