.
This commit is contained in:
@@ -121,6 +121,8 @@ def generic_exam_json_edit(request):
|
|||||||
question_objects = Question.objects.filter(pk__in=question_ids)
|
question_objects = Question.objects.filter(pk__in=question_ids)
|
||||||
|
|
||||||
for i in question_ids:
|
for i in question_ids:
|
||||||
|
# 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(i)
|
||||||
#exam.exam_questions.add(question_objects)
|
#exam.exam_questions.add(question_objects)
|
||||||
exam.save()
|
exam.save()
|
||||||
|
|||||||
Reference in New Issue
Block a user