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
9e6028d3
Commit
9e6028d3
authored
Mar 21, 2018
by
Bessie Steinberg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
revert inital changes for refresh metadata task
parent
081831f8
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
35 additions
and
35 deletions
+35
-35
course_discovery/apps/core/migrations/0009_remove_partner_pubs_api_url.py
+19
-0
course_discovery/apps/core/models.py
+0
-1
course_discovery/apps/course_metadata/data_loaders/api.py
+0
-15
course_discovery/apps/course_metadata/management/commands/refresh_course_metadata.py
+16
-19
No files found.
course_discovery/apps/core/migrations/0009_remove_partner_pubs_api_url.py
0 → 100644
View file @
9e6028d3
# -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2018-03-21 14:53
from
__future__
import
unicode_literals
from
django.db
import
migrations
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'core'
,
'0008_partner_pubs_api_url'
),
]
operations
=
[
migrations
.
RemoveField
(
model_name
=
'partner'
,
name
=
'pubs_api_url'
,
),
]
course_discovery/apps/core/models.py
View file @
9e6028d3
...
...
@@ -67,7 +67,6 @@ class Partner(TimeStampedModel):
max_length
=
8
,
unique
=
True
,
null
=
False
,
blank
=
False
,
verbose_name
=
_
(
'Short Code'
),
help_text
=
_
(
'Convenient code/slug used to identify this Partner (e.g. for management commands.)'
))
courses_api_url
=
models
.
URLField
(
max_length
=
255
,
null
=
True
,
blank
=
True
,
verbose_name
=
_
(
'Courses API URL'
))
pubs_api_url
=
models
.
URLField
(
max_length
=
255
,
null
=
True
,
blank
=
True
,
verbose_name
=
_
(
'Publications API URL'
))
ecommerce_api_url
=
models
.
URLField
(
max_length
=
255
,
null
=
True
,
blank
=
True
,
verbose_name
=
_
(
'E-Commerce API URL'
))
organizations_api_url
=
models
.
URLField
(
max_length
=
255
,
null
=
True
,
blank
=
True
,
verbose_name
=
_
(
'Organizations API URL'
))
...
...
course_discovery/apps/course_metadata/data_loaders/api.py
View file @
9e6028d3
...
...
@@ -249,21 +249,6 @@ class CoursesApiDataLoader(AbstractDataLoader):
return
video
class
PubApiDataLoader
(
AbstractDataLoader
):
""" Loads publications from the Pubs API """
def
ingest
(
self
):
api_url
=
self
.
partner
.
pubs_api_url
count
=
None
page
=
1
logger
.
info
(
'Refreshing publications from
%
s...'
,
api_url
)
while
page
:
response
=
self
.
api_client
.
publications
.
get
(
page
=
page
,
page_size
=
self
.
PAGE_SIZE
)
#TODO: make publications api
class
EcommerceApiDataLoader
(
AbstractDataLoader
):
""" Loads course seats and entitlements from the E-Commerce API. """
...
...
course_discovery/apps/course_metadata/management/commands/refresh_course_metadata.py
View file @
9e6028d3
...
...
@@ -14,7 +14,7 @@ from edx_rest_api_client.client import EdxRestApiClient
from
course_discovery.apps.api.cache
import
api_change_receiver
,
set_api_timestamp
from
course_discovery.apps.core.models
import
Partner
from
course_discovery.apps.course_metadata.data_loaders.api
import
(
CoursesApiDataLoader
,
EcommerceApiDataLoader
,
OrganizationsApiDataLoader
,
ProgramsApiDataLoader
,
PubApiDataLoader
CoursesApiDataLoader
,
EcommerceApiDataLoader
,
OrganizationsApiDataLoader
,
ProgramsApiDataLoader
)
from
course_discovery.apps.course_metadata.data_loaders.marketing_site
import
(
CourseMarketingSiteDataLoader
,
PersonMarketingSiteDataLoader
,
SchoolMarketingSiteDataLoader
,
...
...
@@ -137,26 +137,23 @@ class Command(BaseCommand):
)
pipeline
=
(
# (
# (SubjectMarketingSiteDataLoader, partner.marketing_site_url_root, max_workers),
# (SchoolMarketingSiteDataLoader, partner.marketing_site_url_root, max_workers),
# (SponsorMarketingSiteDataLoader, partner.marketing_site_url_root, max_workers),
# (PersonMarketingSiteDataLoader, partner.marketing_site_url_root, max_workers),
# ),
# (
# (CourseMarketingSiteDataLoader, partner.marketing_site_url_root, max_workers),
# (OrganizationsApiDataLoader, partner.organizations_api_url, max_workers),
# ),
# (
# (CoursesApiDataLoader, partner.courses_api_url, max_workers),
# ),
(
(
PubApiDataLoader
,
partner
.
pubs_api_url
,
max_workers
),
(
SubjectMarketingSiteDataLoader
,
partner
.
marketing_site_url_root
,
max_workers
),
(
SchoolMarketingSiteDataLoader
,
partner
.
marketing_site_url_root
,
max_workers
),
(
SponsorMarketingSiteDataLoader
,
partner
.
marketing_site_url_root
,
max_workers
),
(
PersonMarketingSiteDataLoader
,
partner
.
marketing_site_url_root
,
max_workers
),
),
(
(
CourseMarketingSiteDataLoader
,
partner
.
marketing_site_url_root
,
max_workers
),
(
OrganizationsApiDataLoader
,
partner
.
organizations_api_url
,
max_workers
),
),
(
(
CoursesApiDataLoader
,
partner
.
courses_api_url
,
max_workers
),
),
(
(
EcommerceApiDataLoader
,
partner
.
ecommerce_api_url
,
1
),
(
ProgramsApiDataLoader
,
partner
.
programs_api_url
,
max_workers
),
),
# (
# (EcommerceApiDataLoader, partner.ecommerce_api_url, 1),
# (ProgramsApiDataLoader, partner.programs_api_url, max_workers),
# ),
)
if
waffle
.
switch_is_active
(
'parallel_refresh_pipeline'
):
...
...
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