Merge "Block checkpoint restore/delete when not available"

This commit is contained in:
Jenkins 2016-11-22 08:14:00 +00:00 committed by Gerrit Code Review
commit ba9460e383
1 changed files with 2 additions and 2 deletions

View File

@ -33,7 +33,7 @@ class RestoreCheckpointLink(tables.LinkAction):
return reverse(self.url, args=(checkpoint.provider_id, checkpoint_id))
def allowed(self, request, checkpoint):
return True
return checkpoint.status == 'available'
class DeleteCheckpointsAction(tables.DeleteAction):
@ -50,7 +50,7 @@ class DeleteCheckpointsAction(tables.DeleteAction):
count)
def allowed(self, request, checkpoint):
return True
return checkpoint.status == 'available'
def delete(self, request, obj_id):
datum = self.table.get_object_by_id(obj_id)