Andrew Bogott has submitted this change and it was merged.

Change subject: Puppet Panel:  Cache the project panel tab
......................................................................


Puppet Panel:  Cache the project panel tab

Without this we load it twice sometimes

Change-Id: I1c3b556ba03bee681222081d77d85748d7d9a4cc
---
M modules/openstack/files/liberty/horizon/puppettab/projectpanel.py
1 file changed, 10 insertions(+), 8 deletions(-)

Approvals:
  Andrew Bogott: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/modules/openstack/files/liberty/horizon/puppettab/projectpanel.py 
b/modules/openstack/files/liberty/horizon/puppettab/projectpanel.py
index b28fdfc..97cca49 100644
--- a/modules/openstack/files/liberty/horizon/puppettab/projectpanel.py
+++ b/modules/openstack/files/liberty/horizon/puppettab/projectpanel.py
@@ -51,11 +51,13 @@
     page_title = _("Project Puppet")
 
     def get_tabs(self, request, *args, **kwargs):
-        tenant_id = self.request.user.tenant_id
-        caption = _("These puppet settings will affect all VMs"
-                    " in the %s project.") % tenant_id
-        return self.tab_group_class(request,
-                                    prefix='_',
-                                    caption=caption,
-                                    tenant_id=tenant_id,
-                                    **kwargs)
+        if self._tab_group is None:
+            tenant_id = self.request.user.tenant_id
+            caption = _("These puppet settings will affect all VMs"
+                        " in the %s project.") % tenant_id
+            self._tab_group = self.tab_group_class(request,
+                                                   prefix='_',
+                                                   caption=caption,
+                                                   tenant_id=tenant_id,
+                                                   **kwargs)
+        return self._tab_group

-- 
To view, visit https://gerrit.wikimedia.org/r/311183
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I1c3b556ba03bee681222081d77d85748d7d9a4cc
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Andrew Bogott <abog...@wikimedia.org>
Gerrit-Reviewer: Andrew Bogott <abog...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to