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 1089067..63653e6 100644
--- a/yaksh/views.py
+++ b/yaksh/views.py
@@ -768,7 +768,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')
@@ -792,7 +792,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