Make public services listing list in case insensitive order

This commit is contained in:
Sebastian Pipping 2018-04-22 02:25:31 +02:00
parent 241096408b
commit 82c64d3f2b
1 changed files with 2 additions and 1 deletions

View File

@ -18,6 +18,7 @@ from django.core.exceptions import ValidationError
from django.core.urlresolvers import reverse, reverse_lazy from django.core.urlresolvers import reverse, reverse_lazy
from django.core.validators import URLValidator from django.core.validators import URLValidator
from django.db import transaction from django.db import transaction
from django.db.models.functions import Lower
from django.http import HttpResponse, HttpResponseRedirect, JsonResponse from django.http import HttpResponse, HttpResponseRedirect, JsonResponse
from django.shortcuts import redirect, render from django.shortcuts import redirect, render
from django.template import RequestContext, loader from django.template import RequestContext, loader
@ -822,7 +823,7 @@ class ServicePublicListView(TemplateView):
context = super(ServicePublicListView, self).get_context_data(**kwargs) context = super(ServicePublicListView, self).get_context_data(**kwargs)
context[self.context_object_name] = Service.objects\ context[self.context_object_name] = Service.objects\
.filter(is_public=True, alerts_enabled=True)\ .filter(is_public=True, alerts_enabled=True)\
.order_by('name').prefetch_related('status_checks') .order_by(Lower('name')).prefetch_related('status_checks')
return context return context
class InstanceDetailView(LoginRequiredMixin, DetailView): class InstanceDetailView(LoginRequiredMixin, DetailView):