Skip to content

Commit

Permalink
fix: dont run model unique constraint on ExamSerializer (#265)
Browse files Browse the repository at this point in the history
  • Loading branch information
zacharis278 authored Mar 28, 2024
1 parent 482707e commit 66b2b80
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions edx_exams/apps/api/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,9 @@ class Meta:
'id', 'exam_name', 'course_id', 'content_id', 'time_limit_mins', 'due_date', 'exam_type',
'hide_after_due', 'is_active'
)
# since we use this to bulk create or update without a pk we cannot run the unique constraint
# validator on the model since it won't know which operation we are doing at validation time.
validators = []

def validate_exam_type(self, value):
"""
Expand Down

0 comments on commit 66b2b80

Please sign in to comment.