From a3c2ee6f83dd0a6a136b89819d1e88414ace4ecd Mon Sep 17 00:00:00 2001 From: Duk Loi Date: Wed, 23 Mar 2016 15:03:06 -0400 Subject: [PATCH] Improved handling of Swift panel detection The initial handling of the Swift panel detection can be improved by more closely following the way the detection is done in the Swift Horizon code. Namely, if the setting is not angular then the original default Django panel will be enabled. Also added code to detect if the setting is missing which would also result in the default Django panel being the default. Change-Id: I8d7a44c84405f291780a6767bcb375ba980f3a7a --- trove_dashboard/content/database_backups/tables.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/trove_dashboard/content/database_backups/tables.py b/trove_dashboard/content/database_backups/tables.py index 5379db6..e6ef137 100644 --- a/trove_dashboard/content/database_backups/tables.py +++ b/trove_dashboard/content/database_backups/tables.py @@ -87,8 +87,11 @@ class DownloadBackup(tables.LinkAction): 'object_path': object_path}) def allowed(self, request, datum): - return ((settings.HORIZON_CONFIG['swift_panel'] == 'legacy') and - datum.status == 'COMPLETED') + legacy_swift_panel_enabled = True + if ('swift_panel' in settings.HORIZON_CONFIG and + settings.HORIZON_CONFIG['swift_panel'] == 'angular'): + legacy_swift_panel_enabled = False + return legacy_swift_panel_enabled and datum.status == 'COMPLETED' class DeleteBackup(tables.DeleteAction):