From 5fdc61f576041e2ffa780c1a7d25b1e714ed47c6 Mon Sep 17 00:00:00 2001 From: David Lyle Date: Thu, 30 May 2013 11:56:29 -0600 Subject: [PATCH] Fixing get_panel_groups uncaught exception The get_dashboards method in horizon/base.py returns dashboards that have been unregistered. Subsequently calling get_panel_groups on that dashboard causes an uncaught exception. Fixes: bug#1185914 Change-Id: Ia5a7e7d19e7d2f04731a6840858cd9d9b91cfe00 --- horizon/base.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/horizon/base.py b/horizon/base.py index bc2f37e28..7a1ac829d 100644 --- a/horizon/base.py +++ b/horizon/base.py @@ -411,10 +411,11 @@ class Dashboard(Registry, HorizonComponent): panel_groups = [] # Gather our known panels - for panel_group in self._panel_groups.values(): - for panel in panel_group: - registered.pop(panel.__class__) - panel_groups.append((panel_group.slug, panel_group)) + if self._panel_groups is not None: + for panel_group in self._panel_groups.values(): + for panel in panel_group: + registered.pop(panel.__class__) + panel_groups.append((panel_group.slug, panel_group)) # Deal with leftovers (such as add-on registrations) if len(registered):