.
This commit is contained in:
+3
-1
@@ -121,7 +121,9 @@ def generic_exam_json_edit(request):
|
||||
question_objects = Question.objects.filter(pk__in=question_ids)
|
||||
|
||||
for i in question_ids:
|
||||
exam.exam_questions.add(i)
|
||||
# We get an integrity error if we try to add an object that already exists
|
||||
if not question_objects.filter(pk=i).exists():
|
||||
exam.exam_questions.add(i)
|
||||
#exam.exam_questions.add(question_objects)
|
||||
exam.save()
|
||||
data = {"status": "success"}
|
||||
|
||||
Reference in New Issue
Block a user