Commit ec9df20c by Dudás Ádám

storage: automatically provide value for size field if needed

parent 43f6f38a
......@@ -119,6 +119,11 @@ class Disk(TimeStampedModel):
def __unicode__(self):
return u"%s (#%d)" % (self.name, self.id)
def clean(self, *args, **kwargs):
if self.size == "" and self.base:
self.size = self.base.size
super(Disk, self).clean(*args, **kwargs)
def deploy(self):
"""Reify the disk model on the associated data store.
......
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