Skip to content

Commit

Permalink
Merge pull request #293 from edx/varshamenon4/feat-course-staff-role-…
Browse files Browse the repository at this point in the history
…unique-constraint

feat: add unique constraint to coursestaffrole
  • Loading branch information
varshamenon4 authored Jul 24, 2024
2 parents 0d1c2af + dfe91d9 commit cf036d3
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Generated by Django 4.2.14 on 2024-07-24 14:58

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('core', '0026_studentallowance'),
]

operations = [
migrations.AddConstraint(
model_name='coursestaffrole',
constraint=models.UniqueConstraint(fields=('user', 'course_id', 'role'), name='unique_course_staff_role'),
),
]
5 changes: 5 additions & 0 deletions edx_exams/apps/core/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@ class Meta:
db_table = 'exams_coursestaffrole'
verbose_name = 'course staff role'

constraints = [
models.UniqueConstraint(fields=['user', 'course_id', 'role'],
name='unique_course_staff_role')
]


class ProctoringProvider(TimeStampedModel):
"""
Expand Down

0 comments on commit cf036d3

Please sign in to comment.