summaryrefslogtreecommitdiff
path: root/yaksh
diff options
context:
space:
mode:
authorankitjavalkar2017-08-02 16:05:44 +0530
committerankitjavalkar2017-08-03 17:52:11 +0530
commitd512e7c8f61155c8df43fa3b1ded8b1c3e835125 (patch)
tree57e1e7f667139eb00da793a67ba104cce4f6c7c2 /yaksh
parent08eaf36d6345212a580a2ccddcdfae7bea85191d (diff)
downloadonline_test-d512e7c8f61155c8df43fa3b1ded8b1c3e835125.tar.gz
online_test-d512e7c8f61155c8df43fa3b1ded8b1c3e835125.tar.bz2
online_test-d512e7c8f61155c8df43fa3b1ded8b1c3e835125.zip
Display all hidden courses with pending enrollment requests and rejections
Diffstat (limited to 'yaksh')
-rw-r--r--yaksh/views.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/yaksh/views.py b/yaksh/views.py
index c10ba6a..f6adb2e 100644
--- a/yaksh/views.py
+++ b/yaksh/views.py
@@ -143,7 +143,11 @@ def quizlist_user(request, enrolled=None):
courses = user.students.all()
title = 'Enrolled Courses'
else:
- courses = Course.objects.filter(active=True, is_trial=False, hidden=False)
+ courses = Course.objects.filter(
+ active=True, is_trial=False
+ ).exclude(
+ ~Q(requests=user), ~Q(rejected=user), hidden=True
+ )
title = 'All Courses'
context = {'user': user, 'courses': courses, 'title': title}