Commit 092183d8 by Noraiz Anwar Committed by GitHub

Merge pull request #16214 from edx/noraiz/EDUCATOR-1506

delete_course command with course keys containing unicode chars
parents a9d68c32 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']))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment