summaryrefslogtreecommitdiff
path: root/yaksh/views.py
diff options
context:
space:
mode:
authormaheshgudi2016-09-07 16:14:54 +0530
committermaheshgudi2016-09-07 16:14:54 +0530
commit6e2a0db4d67902cca52277d22dd7a67ebd059268 (patch)
tree770b9067974b572e3378c40a613567c1c49f4029 /yaksh/views.py
parent8b01d249b7ccdff9d75447a6b12eb96641e795e7 (diff)
downloadonline_test-6e2a0db4d67902cca52277d22dd7a67ebd059268.tar.gz
online_test-6e2a0db4d67902cca52277d22dd7a67ebd059268.tar.bz2
online_test-6e2a0db4d67902cca52277d22dd7a67ebd059268.zip
removed initial form field from QuizForm and minor fixes in add_quiz view function and courses template
Diffstat (limited to 'yaksh/views.py')
-rw-r--r--yaksh/views.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/yaksh/views.py b/yaksh/views.py
index dcf6133..fa4dac6 100644
--- a/yaksh/views.py
+++ b/yaksh/views.py
@@ -250,7 +250,7 @@ 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)
+ course = get_object_or_404(Course, pk=course_id)
ci = RequestContext(request)
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!')