Skip to content
Snippets Groups Projects
Commit 8bc7ae14 authored by noraiz-anwar's avatar noraiz-anwar
Browse files

delete_course command with course keys containing unicode chars

parent a9d68c32
No related branches found
No related tags found
No related merge requests found
......@@ -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']))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment