Merge "Instance table minor fixes."

This commit is contained in:
Jenkins 2012-05-22 18:55:26 +00:00 committed by Gerrit Code Review
commit 8d9633d522
2 changed files with 7 additions and 0 deletions

View File

@ -59,6 +59,11 @@ class TerminateInstance(tables.BatchAction):
data_type_plural = _("Instances")
classes = ('btn-danger', 'btn-terminate')
def allowed(self, request, instance=None):
if instance:
return instance.status != "PAUSED"
return True
def action(self, request, obj_id):
api.server_delete(request, obj_id)

View File

@ -48,6 +48,8 @@ class SyspanelInstancesTable(tables.DataTable):
)
STATUS_CHOICES = (
("active", True),
("suspended", True),
("paused", True),
("error", False),
)
TASK_DISPLAY_CHOICES = (