Commit bde448d9 by Chris Dodge

make sure the CourseAccessRole Django ORM Admin page uses a raw_id so that we…

make sure the CourseAccessRole Django ORM Admin page uses a raw_id so that we don't populate millions of rows from the production database in the drop down list
parent 1607b7fc
......@@ -3,7 +3,7 @@ django admin pages for courseware model
'''
from student.models import UserProfile, UserTestGroup, CourseEnrollmentAllowed
from student.models import CourseEnrollment, Registration, PendingNameChange, CourseAccessRole
from student.models import CourseEnrollment, Registration, PendingNameChange, CourseAccessRole, CourseAccessRoleAdmin
from ratelimitbackend import admin
admin.site.register(UserProfile)
......@@ -18,4 +18,4 @@ admin.site.register(Registration)
admin.site.register(PendingNameChange)
admin.site.register(CourseAccessRole)
admin.site.register(CourseAccessRole, CourseAccessRoleAdmin)
......@@ -45,6 +45,8 @@ from functools import total_ordering
from certificates.models import GeneratedCertificate
from course_modes.models import CourseMode
from ratelimitbackend import admin
unenroll_done = Signal(providing_args=["course_enrollment"])
log = logging.getLogger(__name__)
AUDIT_LOG = logging.getLogger("audit")
......@@ -1048,6 +1050,9 @@ class CourseAccessRole(models.Model):
return "[CourseAccessRole] user: {} role: {} org: {} course: {}".format(self.user.username, self.role, self.org, self.course_id)
class CourseAccessRoleAdmin(admin.ModelAdmin):
raw_id_fields = ("user",)
#### Helper methods for use from python manage.py shell and other classes.
......
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