diff --git a/manager/templatetags/manager.py b/manager/templatetags/manager.py index b22d039..f1c95df 100644 --- a/manager/templatetags/manager.py +++ b/manager/templatetags/manager.py @@ -10,13 +10,13 @@ def orgaString(context): @register.simple_tag(takes_context=True) def userDevices(context): - return set(Device.objects.filter(organization__in=context.request.user.organization_set.all())) + return sorted(set(Device.objects.filter(organization__in=context.request.user.organization_set.all())), key=lambda x: x.serial) @register.simple_tag(takes_context=True) def userWifis(context): - return set(Wifi.objects.filter(organization__in=context.request.user.organization_set.all())) + return sorted(set(Wifi.objects.filter(organization__in=context.request.user.organization_set.all())), key=lambda x: x.serial) @register.simple_tag(takes_context=True) def userUsers(context): - return set(User.objects.filter(organization__in=context.request.user.organization_set.all()) if context.request.user.is_superuser else []) + return sorted(set(User.objects.filter(organization__in=context.request.user.organization_set.all()) if context.request.user.is_superuser else []), key=lambda x: x.username)