Skip to content

Commit

Permalink
feat: add unique constraint to coursestaffrole
Browse files Browse the repository at this point in the history
  • Loading branch information
varshamenon4 committed Jul 24, 2024
1 parent 0d1c2af commit dfe91d9
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 dfe91d9

Please sign in to comment.