Skip to content

Commit

Permalink
fix: exclude 'course_key' field from the django admin form on course_…
Browse files Browse the repository at this point in the history
…action_state
  • Loading branch information
schenedx committed Feb 5, 2025
1 parent 3227566 commit 3351d41
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion common/djangoapps/course_action_state/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,16 @@

from common.djangoapps.course_action_state.models import CourseRerunState

admin.site.register(CourseRerunState)

class CourseRerunStateAdmin(admin.ModelAdmin):

exclude = ["course_key"]

def get_queryset(self, request):
# For any query against this table, remove course_key field
# because that field might have bad data in it.
qs = CourseRerunState.objects.defer('course_key')
return qs


admin.site.register(CourseRerunState, CourseRerunStateAdmin)

0 comments on commit 3351d41

Please sign in to comment.