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
def8327c
Commit
def8327c
authored
Jun 01, 2017
by
Awais
Committed by
Awais Qureshi
Jun 01, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixing import course page in publisher.
Only a given id course will be downloaded. ECOM-7845
parent
58e81af1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
4 deletions
+7
-4
course_discovery/apps/publisher/forms.py
+1
-1
course_discovery/apps/publisher/views.py
+6
-3
No files found.
course_discovery/apps/publisher/forms.py
View file @
def8327c
...
...
@@ -499,7 +499,7 @@ class CourseRunAdminForm(forms.ModelForm):
class
AdminImportCourseForm
(
forms
.
Form
):
start_id
=
forms
.
IntegerField
(
min_value
=
1
,
label
=
'This course id will import
along with next 9 courses
.'
)
start_id
=
forms
.
IntegerField
(
min_value
=
1
,
label
=
'This course id will import.'
)
class
Meta
:
fields
=
(
'start_id'
,)
course_discovery/apps/publisher/views.py
View file @
def8327c
...
...
@@ -882,8 +882,8 @@ class AdminImportCourse(mixins.LoginRequiredMixin, TemplateView):
def
post
(
self
,
request
,
*
args
,
**
kwargs
):
"""Post method for import page."""
# inline import to avoid any circular issues.
from
course_discovery.apps.course_metadata.models
import
Course
as
metadata_course
#
inline import to avoid any circular issues.
from
course_discovery.apps.course_metadata.models
import
Course
as
CourseMetaData
if
not
(
self
.
request
.
user
.
is_superuser
and
waffle
.
switch_is_active
(
'publisher_enable_course_import'
)):
raise
Http404
...
...
@@ -892,7 +892,10 @@ class AdminImportCourse(mixins.LoginRequiredMixin, TemplateView):
if
form
.
is_valid
():
start_id
=
self
.
request
.
POST
.
get
(
'start_id'
)
for
course
in
metadata_course
.
objects
.
filter
(
id__range
=
(
start_id
,
int
(
start_id
)
+
9
)):
for
course
in
CourseMetaData
.
objects
.
select_related
(
'canonical_course_run'
,
'level_type'
,
'video'
)
.
filter
(
id
=
start_id
):
process_course
(
course
)
return
super
(
AdminImportCourse
,
self
)
.
get
(
request
,
args
,
**
kwargs
,)
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