Commit 94adcc77 by Dudás Ádám

storage: utilize destroyed flag

parent 703a3fe0
......@@ -161,6 +161,10 @@ class Disk(TimeStampedModel):
otherwise, False.
:rtype: bool
if self.destroyed:
self.destroyed = None
if self.ready:
return False
......@@ -191,10 +195,15 @@ class Disk(TimeStampedModel):
def destroy(self, user=None, task_uuid=None):
if self.destroyed:
return False
# TODO add activity logging
self.destroyed =
return True
def destroy_async(self, user=None):
local_tasks.destroy.apply_async(args=[self, user],
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment