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 4, 2025
1 parent c84af05 commit 69884a8
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 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,15 @@

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 69884a8

Please sign in to comment.