diff --git a/openstack_dashboard/dashboards/project/database_backups/tables.py b/openstack_dashboard/dashboards/project/database_backups/tables.py index 63d471304b..3fe6b92c98 100644 --- a/openstack_dashboard/dashboards/project/database_backups/tables.py +++ b/openstack_dashboard/dashboards/project/database_backups/tables.py @@ -47,6 +47,9 @@ class RestoreLink(tables.LinkAction): url = "horizon:project:databases:launch" classes = ("btn-launch", "ajax-modal") + def allowed(self, request, backup=None): + return backup.status == 'COMPLETED' + def get_link_url(self, datum): url = reverse(self.url) return url + '?backup=%s' % datum.id diff --git a/openstack_dashboard/dashboards/project/databases/workflows/create_instance.py b/openstack_dashboard/dashboards/project/databases/workflows/create_instance.py index 7137e7d4ed..94f9f433fd 100644 --- a/openstack_dashboard/dashboards/project/databases/workflows/create_instance.py +++ b/openstack_dashboard/dashboards/project/databases/workflows/create_instance.py @@ -123,7 +123,8 @@ class RestoreAction(workflows.Action): empty = [('', '-')] try: backups = api.trove.backup_list(request) - backup_list = [(b.id, b.name) for b in backups] + backup_list = [(b.id, b.name) for b in backups + if b.status == 'COMPLETED'] except Exception: backup_list = [] return empty + backup_list