diff --git a/openstack_dashboard/api/keystone.py b/openstack_dashboard/api/keystone.py index da726d1c35..2b5eb5ba42 100644 --- a/openstack_dashboard/api/keystone.py +++ b/openstack_dashboard/api/keystone.py @@ -264,7 +264,13 @@ def tenant_list(request, paginate=False, marker=None, domain=None, user=None, limit = page_size + 1 has_more_data = False - if VERSIONS.active < 3: + + # if requesting the projects for the current user, + # return the list from the cache + if user == request.user.id: + tenants = request.user.authorized_tenants + + elif VERSIONS.active < 3: tenants = manager.list(limit, marker) if paginate and len(tenants) > page_size: tenants.pop(-1) diff --git a/openstack_dashboard/dashboards/identity/projects/views.py b/openstack_dashboard/dashboards/identity/projects/views.py index 3754f309d3..a6dbb9dc50 100644 --- a/openstack_dashboard/dashboards/identity/projects/views.py +++ b/openstack_dashboard/dashboards/identity/projects/views.py @@ -78,6 +78,7 @@ class IndexView(tables.DataTableView): marker = self.request.GET.get( project_tables.TenantsTable._meta.pagination_param, None) domain_context = self.request.session.get('domain_context', None) + self._more = False if policy.check((("identity", "identity:list_projects"),), self.request): try: @@ -87,7 +88,6 @@ class IndexView(tables.DataTableView): paginate=True, marker=marker) except Exception: - self._more = False exceptions.handle(self.request, _("Unable to retrieve project list.")) elif policy.check((("identity", "identity:list_user_projects"),), @@ -100,11 +100,9 @@ class IndexView(tables.DataTableView): marker=marker, admin=False) except Exception: - self._more = False exceptions.handle(self.request, _("Unable to retrieve project information.")) else: - self._more = False msg = \ _("Insufficient privilege level to view project information.") messages.info(self.request, msg)