Commit ab138702 by Dudás Ádám

vm: fill empty time_of_delete field on model clean

parent b31f9b65
...@@ -423,6 +423,11 @@ class Instance(AclBase, VirtualMachineDescModel, TimeStampedModel): ...@@ -423,6 +423,11 @@ class Instance(AclBase, VirtualMachineDescModel, TimeStampedModel):
parts = [self.name, "(" + str(self.id) + ")"] parts = [self.name, "(" + str(self.id) + ")"]
return " ".join([s for s in parts if s != ""]) return " ".join([s for s in parts if s != ""])
def clean(self, *args, **kwargs):
if self.time_of_delete is None:
self.renew(which='delete')
super(Instance, self).clean(*args, **kwargs)
@classmethod @classmethod
def create_from_template(cls, template, owner, disks=None, networks=None, def create_from_template(cls, template, owner, disks=None, networks=None,
req_traits=None, tags=None, **kwargs): req_traits=None, tags=None, **kwargs):
......
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