Skip to content
Snippets Groups Projects
Commit 0ffd3699 authored by David Ormsbee's avatar David Ormsbee
Browse files

Add ability to manually fail instructor tasks in batches.

When an InstructorTask is stuck in QUEUING (say if there was a
problem with celery), the support team needs to manually intervene
and mark the task as "FAILED" so that new tasks of that type can
be created for that course. This is usually done one at a time,
but sometimes a bug or outage might cause many tasks to fail at
once, making recovery extremely cumbersome. This commit adds the
ability to do this process in batches.
parent 1edec15d
No related branches found
No related tags found
No related merge requests found
......@@ -5,8 +5,6 @@ This will mostly involve searching by course_id or task_id and manually failing
a task.
"""
from config_models.admin import ConfigurationModelAdmin
from django.contrib import admin
......@@ -14,9 +12,21 @@ from .config.models import GradeReportSetting
from .models import InstructorTask
def mark_tasks_as_failed(modeladmin, request, queryset):
queryset.update(
task_state='FAILURE',
task_output='{}',
task_key='dummy_task_key',
)
mark_tasks_as_failed.short_description = "Mark Tasks as Failed"
class InstructorTaskAdmin(admin.ModelAdmin):
actions = [mark_tasks_as_failed]
list_display = [
'task_id',
'task_state',
'task_type',
'course_id',
'username',
......
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