Unverified Commit ccf34471 by sanfordstudent Committed by GitHub

Merge pull request #16763 from edx/sstudent/remove_broken_admin

remove broken subsection grade override admin
parents d9058998 174d0393
...@@ -3,14 +3,12 @@ Django admin page for grades models ...@@ -3,14 +3,12 @@ Django admin page for grades models
""" """
from config_models.admin import ConfigurationModelAdmin, KeyedConfigurationModelAdmin from config_models.admin import ConfigurationModelAdmin, KeyedConfigurationModelAdmin
from django.contrib import admin from django.contrib import admin
from django.utils.translation import ugettext_lazy as _
from lms.djangoapps.grades.config.forms import CoursePersistentGradesAdminForm from lms.djangoapps.grades.config.forms import CoursePersistentGradesAdminForm
from lms.djangoapps.grades.config.models import ( from lms.djangoapps.grades.config.models import (
ComputeGradesSetting, ComputeGradesSetting,
CoursePersistentGradesFlag, CoursePersistentGradesFlag,
PersistentGradesEnabledFlag PersistentGradesEnabledFlag
) )
from lms.djangoapps.grades.models import PersistentSubsectionGradeOverride, PersistentSubsectionGrade
class CoursePersistentGradesAdmin(KeyedConfigurationModelAdmin): class CoursePersistentGradesAdmin(KeyedConfigurationModelAdmin):
...@@ -27,49 +25,6 @@ class CoursePersistentGradesAdmin(KeyedConfigurationModelAdmin): ...@@ -27,49 +25,6 @@ class CoursePersistentGradesAdmin(KeyedConfigurationModelAdmin):
}), }),
) )
class PersistentSubsectionGradeOverrideAdmin(admin.ModelAdmin):
fieldsets = (
(None, {
'fields': (
'grade',
'earned_all_override',
'earned_graded_override',
'possible_all_override',
'possible_graded_override',
),
'description': 'Enter the ID of the subsection grade you want to override. You will probably need to '
'find this in the read replica in the grades_persistentsubsectiongrade table.'
}),
)
list_display = [
'get_course_id',
'get_usage_key',
'get_user_id',
'earned_all_override',
'earned_graded_override',
'created',
'modified',
]
list_filter = ('grade__course_id', 'grade__user_id',)
raw_id_fields = ('grade',)
search_fields = ['grade__course_id', 'grade__user_id', 'grade__usage_key']
def get_course_id(self, persistent_grade):
return persistent_grade.grade.course_id
def get_usage_key(self, persistent_grade):
return persistent_grade.grade.usage_key
def get_user_id(self, persistent_grade):
return persistent_grade.grade.user_id
get_course_id.short_description = _('Course Id')
get_usage_key.short_description = _('Usage Key')
get_user_id.short_description = _('User Id')
admin.site.register(CoursePersistentGradesFlag, CoursePersistentGradesAdmin) admin.site.register(CoursePersistentGradesFlag, CoursePersistentGradesAdmin)
admin.site.register(PersistentGradesEnabledFlag, ConfigurationModelAdmin) admin.site.register(PersistentGradesEnabledFlag, ConfigurationModelAdmin)
admin.site.register(ComputeGradesSetting, ConfigurationModelAdmin) admin.site.register(ComputeGradesSetting, ConfigurationModelAdmin)
admin.site.register(PersistentSubsectionGradeOverride, PersistentSubsectionGradeOverrideAdmin)
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