From 02b7757d1b620257aa54420a702fe3b6ea18abcb Mon Sep 17 00:00:00 2001 From: Miles Steele Date: Mon, 22 Jul 2013 13:17:59 -0400 Subject: [PATCH] add catch for tasks AlreadyRunning --- lms/djangoapps/instructor/views/api.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lms/djangoapps/instructor/views/api.py b/lms/djangoapps/instructor/views/api.py index ac4a459a3d..48b3de62e1 100644 --- a/lms/djangoapps/instructor/views/api.py +++ b/lms/djangoapps/instructor/views/api.py @@ -25,6 +25,7 @@ from django_comment_common.models import (Role, from courseware.models import StudentModule import instructor_task.api +from instructor_task.api_helper import AlreadyRunningError import instructor.enrollment as enrollment from instructor.enrollment import enroll_email, unenroll_email import instructor.access as access @@ -45,6 +46,8 @@ def common_exceptions_400(func): return func(*args, **kwargs) except User.DoesNotExist: return HttpResponseBadRequest("User does not exist.") + except AlreadyRunningError: + return HttpResponseBadRequest("Task already running.") return wrapped