From d512e7c8f61155c8df43fa3b1ded8b1c3e835125 Mon Sep 17 00:00:00 2001 From: ankitjavalkar Date: Wed, 2 Aug 2017 16:05:44 +0530 Subject: Display all hidden courses with pending enrollment requests and rejections --- yaksh/views.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'yaksh') 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} -- cgit