Commit 47f3d6ce by Justin Riley

add reapply_extensions instructor management command

parent d7d6f54c
#!/usr/bin/python
from django.http import Http404
from django.core.management.base import BaseCommand, CommandError
from courseware.courses import get_course_by_id
from instructor.views.tools import fix_missing_extensions
class Command(BaseCommand):
args = "<course_id>"
help = "Reapply all extensions (fixes extensions for newly added problems)"
def handle(self, *args, **options):
if len(args) != 1:
raise CommandError("insufficient arguments")
try:
course = get_course_by_id(args[0])
fix_missing_extensions(course)
except Http404 as e:
raise CommandError(e)
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