Sort list of lists by group name instead of group id (#86)

This commit is contained in:
james1293 2019-09-20 01:37:38 -04:00 committed by Scot Hacker
parent 4f9f379543
commit d07cb30fce

View file

@ -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()