summaryrefslogtreecommitdiff
path: root/yaksh/views.py
diff options
context:
space:
mode:
authormaheshgudi2016-09-06 15:14:50 +0530
committermaheshgudi2016-09-06 15:14:50 +0530
commit8b01d249b7ccdff9d75447a6b12eb96641e795e7 (patch)
tree5464e51a2445fd1384c790dac891bcc800e2a2e1 /yaksh/views.py
parent848f7945811f1d16bdf8d5e2a99d157d9ed9a18c (diff)
downloadonline_test-8b01d249b7ccdff9d75447a6b12eb96641e795e7.tar.gz
online_test-8b01d249b7ccdff9d75447a6b12eb96641e795e7.tar.bz2
online_test-8b01d249b7ccdff9d75447a6b12eb96641e795e7.zip
changed test cases to reflect changes in addquiz view function
Diffstat (limited to 'yaksh/views.py')
-rw-r--r--yaksh/views.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/yaksh/views.py b/yaksh/views.py
index 0fb2214..dcf6133 100644
--- a/yaksh/views.py
+++ b/yaksh/views.py
@@ -250,8 +250,9 @@ def add_quiz(request, course_id, quiz_id=None):
"""To add a new quiz in the database.
Create a new quiz and store it."""
user = request.user
+ course = Course.objects.get(id=course_id)
ci = RequestContext(request)
- if not is_moderator(user):
+ if not is_moderator(user) or (user != course.creator and user not in course.teachers.all()):
raise Http404('You are not allowed to view this page!')
context = {}
if request.method == "POST":