summaryrefslogtreecommitdiff
path: root/yaksh/views.py
diff options
context:
space:
mode:
Diffstat (limited to 'yaksh/views.py')
-rw-r--r--yaksh/views.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/yaksh/views.py b/yaksh/views.py
index 74c409c..4c53d69 100644
--- a/yaksh/views.py
+++ b/yaksh/views.py
@@ -771,7 +771,7 @@ def ajax_questions_filter(request):
"""Ajax call made when filtering displayed questions."""
user = request.user
- filter_dict = {"user_id": user.id}
+ filter_dict = {"user_id": user.id, "active": True}
question_type = request.POST.get('question_type')
marks = request.POST.get('marks')
language = request.POST.get('language')
@@ -795,7 +795,10 @@ def _get_questions(user, question_type, marks):
if question_type is None and marks is None:
return None
if question_type:
- questions = Question.objects.filter(type=question_type, user=user)
+ questions = Question.objects.filter(type=question_type,
+ user=user,
+ active=True
+ )
if marks:
questions = questions.filter(points=marks)
return questions