From ed532c50d3f5c61ba3ce39d07c8c0c21e6c9c171 Mon Sep 17 00:00:00 2001 From: CruiseDevice Date: Wed, 13 Feb 2019 15:50:00 +0530 Subject: Add Preview QuestionPaper button in Quiz view page --- yaksh/views.py | 2 -- 1 file changed, 2 deletions(-) (limited to 'yaksh/views.py') diff --git a/yaksh/views.py b/yaksh/views.py index 6c7a12e..bcaaf5f 100644 --- a/yaksh/views.py +++ b/yaksh/views.py @@ -2822,8 +2822,6 @@ def _update_course_percent(course, user): @email_verified def preview_questionpaper(request, questionpaper_id): user = request.user - if not is_moderator(user): - raise Http404('You are not allowed to view this page!') paper = QuestionPaper.objects.get(id=questionpaper_id) if not paper.quiz.creator == user: raise Http404('This questionpaper does not belong to you') -- cgit From 89c0367ba2364319e6febab191fd46b822b4f6bc Mon Sep 17 00:00:00 2001 From: CruiseDevice Date: Thu, 14 Feb 2019 15:05:42 +0530 Subject: Add Preview Question Paper button in add_quiz template --- yaksh/views.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'yaksh/views.py') diff --git a/yaksh/views.py b/yaksh/views.py index bcaaf5f..6c7a12e 100644 --- a/yaksh/views.py +++ b/yaksh/views.py @@ -2822,6 +2822,8 @@ def _update_course_percent(course, user): @email_verified def preview_questionpaper(request, questionpaper_id): user = request.user + if not is_moderator(user): + raise Http404('You are not allowed to view this page!') paper = QuestionPaper.objects.get(id=questionpaper_id) if not paper.quiz.creator == user: raise Http404('This questionpaper does not belong to you') -- cgit From cc710ca137bb5866c6771ba60b94a9fcce9054c5 Mon Sep 17 00:00:00 2001 From: CruiseDevice Date: Mon, 18 Feb 2019 15:51:52 +0530 Subject: Remove the duplicate condition to check if user is quiz creator in preview_questionpaper view --- yaksh/views.py | 2 -- 1 file changed, 2 deletions(-) (limited to 'yaksh/views.py') diff --git a/yaksh/views.py b/yaksh/views.py index 6c7a12e..1ea7a22 100644 --- a/yaksh/views.py +++ b/yaksh/views.py @@ -2825,8 +2825,6 @@ def preview_questionpaper(request, questionpaper_id): if not is_moderator(user): raise Http404('You are not allowed to view this page!') paper = QuestionPaper.objects.get(id=questionpaper_id) - if not paper.quiz.creator == user: - raise Http404('This questionpaper does not belong to you') context = { 'questions': paper._get_questions_for_answerpaper(), 'paper': paper, -- cgit