diff --git a/edx_exams/apps/api/v1/tests/test_views.py b/edx_exams/apps/api/v1/tests/test_views.py index 59d071d7..b8f8eaef 100644 --- a/edx_exams/apps/api/v1/tests/test_views.py +++ b/edx_exams/apps/api/v1/tests/test_views.py @@ -355,7 +355,8 @@ def test_course_staff_write_access(self): Verify course staff have write access """ course_staff_user = UserFactory() - CourseStaffRole.objects.create(user=course_staff_user, course_id=self.course_id) + CourseStaffRole.objects.create(user=course_staff_user, course_id=self.course_id, role='staff') + CourseStaffRole.objects.create(user=course_staff_user, course_id=self.course_id, role='instructor') response = self.patch_api(course_staff_user, { 'provider': None, 'escalation_email': None, diff --git a/edx_exams/apps/core/admin.py b/edx_exams/apps/core/admin.py index b1651fa9..112a6011 100644 --- a/edx_exams/apps/core/admin.py +++ b/edx_exams/apps/core/admin.py @@ -99,7 +99,7 @@ def get_exam_name(self, obj): class CourseStaffRoleAdmin(admin.ModelAdmin): """ Admin configuration for the Course Staff Role model """ raw_id_fields = ('user',) - list_display = ('user', 'course_id') + list_display = ('user', 'course_id', 'role') list_filter = ('course_id',) search_fields = ('user__username', 'course_id') ordering = ('course_id',) diff --git a/edx_exams/apps/core/migrations/0024_coursestaffrole_role.py b/edx_exams/apps/core/migrations/0024_coursestaffrole_role.py new file mode 100644 index 00000000..d37ce778 --- /dev/null +++ b/edx_exams/apps/core/migrations/0024_coursestaffrole_role.py @@ -0,0 +1,18 @@ +# Generated by Django 3.2.23 on 2024-02-06 14:25 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('core', '0023_proctoringprovider_tech_support_url'), + ] + + operations = [ + migrations.AddField( + model_name='coursestaffrole', + name='role', + field=models.CharField(max_length=255, null=True), + ), + ] diff --git a/edx_exams/apps/core/models.py b/edx_exams/apps/core/models.py index 53fc9aa9..8af9d257 100644 --- a/edx_exams/apps/core/models.py +++ b/edx_exams/apps/core/models.py @@ -65,6 +65,8 @@ class CourseStaffRole(TimeStampedModel): course_id = models.CharField(max_length=255, db_index=True) + role = models.CharField(max_length=255, null=True) + class Meta: """ Meta class for this Django model """ db_table = 'exams_coursestaffrole'