summaryrefslogtreecommitdiff
path: root/yaksh/views.py
diff options
context:
space:
mode:
authorPrabhu Ramachandran2017-11-06 16:53:07 +0530
committerGitHub2017-11-06 16:53:07 +0530
commit807a52e45a9b6c6ac64a7a5e4bd8248900fb4367 (patch)
tree9d3ee3e2db55bd2d962aa6632159cc2d122405aa /yaksh/views.py
parent6b8ecc840698b7793c1d8fd350da8c85f1b02b7d (diff)
parent52afb684b1bd59cc1d5f2f1a6963b877a5604b37 (diff)
downloadonline_test-807a52e45a9b6c6ac64a7a5e4bd8248900fb4367.tar.gz
online_test-807a52e45a9b6c6ac64a7a5e4bd8248900fb4367.tar.bz2
online_test-807a52e45a9b6c6ac64a7a5e4bd8248900fb4367.zip
Merge pull request #376 from Akshen/develop
Fix Course Ordering in Courses Page
Diffstat (limited to 'yaksh/views.py')
-rw-r--r--yaksh/views.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/yaksh/views.py b/yaksh/views.py
index c50ba33..63da956 100644
--- a/yaksh/views.py
+++ b/yaksh/views.py
@@ -792,8 +792,10 @@ def courses(request):
ci = RequestContext(request)
if not is_moderator(user):
raise Http404('You are not allowed to view this page')
- courses = Course.objects.filter(creator=user, is_trial=False)
- allotted_courses = Course.objects.filter(teachers=user, is_trial=False)
+ courses = Course.objects.filter(
+ creator=user, is_trial=False).order_by('-active', '-id')
+ allotted_courses = Course.objects.filter(
+ teachers=user, is_trial=False).order_by('-active', '-id')
context = {'courses': courses, "allotted_courses": allotted_courses}
return my_render_to_response('yaksh/courses.html', context,
context_instance=ci)