Block checkpoint restore/delete when not available

Closes-Bug: #1622596
Change-Id: Icc34ff5464d632a91713d4d7532c58e4c1cea974
This commit is contained in:
Yuval Brik 2016-11-17 13:49:05 +02:00
parent 4cee645ef0
commit 93e22f5acd
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)