summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--yaksh/views.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/yaksh/views.py b/yaksh/views.py
index 2adc2c3..247aca4 100644
--- a/yaksh/views.py
+++ b/yaksh/views.py
@@ -661,8 +661,7 @@ def course_detail(request, course_id):
raise Http404('You are not allowed to view this page')
course = get_object_or_404(Course, pk=course_id)
- if not course.is_creator(user) and not course.is_teacher(user):
- raise Http404('This course does not belong to you')
+
return my_render_to_response('yaksh/course_detail.html', {'course': course},
context_instance=ci)
@@ -859,7 +858,9 @@ def design_questionpaper(request, quiz_id, questionpaper_id=None):
if not is_moderator(user):
raise Http404('You are not allowed to view this page!')
-
+ quiz = Quiz.objects.get(id=quiz_id)
+ if not quiz.course.is_creator(user) and not quiz.course.is_teacher(user):
+ raise Http404('This course does not belong to you')
filter_form = QuestionFilterForm(user=user)
questions = None
marks = None