From 18bcee09c9bb1b55f392bdf44f69f5fbbf29e0e7 Mon Sep 17 00:00:00 2001 From: Zacharis278 Date: Wed, 27 Mar 2024 16:38:11 -0400 Subject: [PATCH] fix: dont run model unique constraint on ExamSerializer --- edx_exams/apps/api/serializers.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/edx_exams/apps/api/serializers.py b/edx_exams/apps/api/serializers.py index 92ae1330..b48998d2 100644 --- a/edx_exams/apps/api/serializers.py +++ b/edx_exams/apps/api/serializers.py @@ -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): """