Skip to content

Commit

Permalink
Sort list of lists by group name instead of group id (#86)
Browse files Browse the repository at this point in the history
  • Loading branch information
james1293 authored and shacker committed Sep 20, 2019
1 parent 4f9f379 commit d07cb30
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions todo/views/list_lists.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ def list_lists(request) -> HttpResponse:

# Superusers see all lists
if request.user.is_superuser:
lists = TaskList.objects.all().order_by("group", "name")
lists = TaskList.objects.all().order_by("group__name", "name")
else:
lists = TaskList.objects.filter(group__in=request.user.groups.all()).order_by(
"group", "name"
"group__name", "name"
)

list_count = lists.count()
Expand Down

0 comments on commit d07cb30

Please sign in to comment.