Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hsin-Yu Chien
edx-platform-release
Commits
8bc7ae14
Commit
8bc7ae14
authored
7 years ago
by
noraiz-anwar
Browse files
Options
Downloads
Patches
Plain Diff
delete_course command with course keys containing unicode chars
parent
a9d68c32
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
cms/djangoapps/contentstore/management/commands/delete_course.py
+7
-2
7 additions, 2 deletions
...ngoapps/contentstore/management/commands/delete_course.py
with
7 additions
and
2 deletions
cms/djangoapps/contentstore/management/commands/delete_course.py
+
7
−
2
View file @
8bc7ae14
...
...
@@ -32,7 +32,10 @@ class Command(BaseCommand):
help
=
'
Delete a MongoDB backed course
'
def
add_arguments
(
self
,
parser
):
parser
.
add_argument
(
'
course_key
'
,
help
=
'
ID of the course to delete.
'
)
parser
.
add_argument
(
'
course_key
'
,
help
=
'
ID of the course to delete.
'
,
)
parser
.
add_argument
(
'
--keep-instructors
'
,
...
...
@@ -50,7 +53,9 @@ class Command(BaseCommand):
def
handle
(
self
,
*
args
,
**
options
):
try
:
course_key
=
CourseKey
.
from_string
(
options
[
'
course_key
'
])
# a course key may have unicode chars in it
course_key
=
unicode
(
options
[
'
course_key
'
],
'
utf8
'
)
course_key
=
CourseKey
.
from_string
(
course_key
)
except
InvalidKeyError
:
raise
CommandError
(
'
Invalid course_key: {}
'
.
format
(
options
[
'
course_key
'
]))
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment