Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add unique constraint to coursestaffrole #293

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading