summaryrefslogtreecommitdiff
path: root/yaksh/models.py
diff options
context:
space:
mode:
authorankitjavalkar2017-04-28 15:01:18 +0530
committerankitjavalkar2017-04-28 17:16:45 +0530
commit3597ee5fa814b0c7c737e72797d9e9911ca5e0dd (patch)
tree0935e7b5cdbb5d72d2c106ca7234520c985d4291 /yaksh/models.py
parent976713c1cd2f7a74aaa6893ade275190c385198a (diff)
downloadonline_test-3597ee5fa814b0c7c737e72797d9e9911ca5e0dd.tar.gz
online_test-3597ee5fa814b0c7c737e72797d9e9911ca5e0dd.tar.bz2
online_test-3597ee5fa814b0c7c737e72797d9e9911ca5e0dd.zip
- Fix bug that prevents addition of a prerequisite to foreignkey field
- Fix test cases to ensure fails if prerequisite is not set
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 018a0dd..ad64f2a 100644
--- a/yaksh/models.py
+++ b/yaksh/models.py
@@ -182,7 +182,8 @@ class Course(models.Model):
duplicate_prerequisite = Quiz.objects.get(
id=duplicate_prereq_id
)
- duplicate_quiz.prerequisite.add(duplicate_prerequisite)
+ duplicate_quiz.prerequisite = duplicate_prerequisite
+ duplicate_quiz.save()
return new_course