Commit 09bc765c by David Ormsbee

Add admin.py for instructor_task.

This is primarily so that we can manually fail zombie instructor
tasks that are clogging up the queue for a course.
parent fbde1cf3
"""
Basic admin screens to search and edit InstructorTasks.
This will mostly involve searching by course_id or task_id and manually failing
a task.
"""
from django.contrib import admin
from .models import InstructorTask
class InstructorTaskAdmin(admin.ModelAdmin):
list_display = [
'task_id',
'task_type',
'course_id',
'username',
'email',
'created',
'updated',
]
list_filter = ['task_type', 'task_state']
search_fields = [
'task_id', 'course_id', 'requester__email', 'requester__username'
]
raw_id_fields = ['requester'] # avoid trying to make a select dropdown
def email(self, task):
return task.requester.email
email.admin_order_field = 'requester__email'
def username(self, task):
return task.requester.username
email.admin_order_field = 'requester__username'
admin.site.register(InstructorTask, InstructorTaskAdmin)
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