summaryrefslogtreecommitdiff
path: root/yaksh/models.py
diff options
context:
space:
mode:
Diffstat (limited to 'yaksh/models.py')
-rw-r--r--yaksh/models.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/yaksh/models.py b/yaksh/models.py
index 73fbb66..f8458f3 100644
--- a/yaksh/models.py
+++ b/yaksh/models.py
@@ -1753,7 +1753,8 @@ class QuestionPaperManager(models.Manager):
def create_trial_paper_to_test_quiz(self, trial_quiz, original_quiz_id):
"""Creates a trial question paper to test quiz."""
- trial_quiz.questionpaper_set.all().delete()
+ if self.filter(quiz=trial_quiz).exists():
+ self.get(quiz=trial_quiz).delete()
trial_questionpaper, trial_questions = \
self._create_trial_from_questionpaper(original_quiz_id)
trial_questionpaper.quiz = trial_quiz