diff --git a/openstack_dashboard/templatetags/context_selection.py b/openstack_dashboard/templatetags/context_selection.py index 164bd577b8..bf0c861893 100644 --- a/openstack_dashboard/templatetags/context_selection.py +++ b/openstack_dashboard/templatetags/context_selection.py @@ -77,14 +77,13 @@ def show_domain_list(context): @register.inclusion_tag('context_selection/_project_list.html', takes_context=True) def show_project_list(context): - max_proj = getattr(settings, - 'DROPDOWN_MAX_ITEMS', - 30) + max_proj = getattr(settings, 'DROPDOWN_MAX_ITEMS', 30) if 'request' not in context: return {} request = context['request'] - context = {'projects': sorted(context['authorized_tenants'], - key=lambda project: project.name)[:max_proj], + projects = sorted(context['authorized_tenants'], + key=lambda project: project.name.lower()) + context = {'projects': projects[:max_proj], 'project_id': request.user.project_id, 'request': request} return context @@ -97,7 +96,8 @@ def show_region_list(context): return {} request = context['request'] context = {'region_name': request.user.services_region, - 'regions': sorted(request.user.available_services_regions), + 'regions': sorted(request.user.available_services_regions, + key=lambda x: x.lower()), 'request': request} return context