Commit 70b50134 by Kálmán Viktor

storage: fix Disk.create_empty activity problem

parent d4737b15
...@@ -287,13 +287,9 @@ class Disk(AclBase, TimeStampedModel): ...@@ -287,13 +287,9 @@ class Disk(AclBase, TimeStampedModel):
:return: Disk object without a real image, to be .deploy()ed later. :return: Disk object without a real image, to be .deploy()ed later.
""" """
with disk_activity(code_suffix="create", user=user) as act:
disk = cls(**kwargs) disk = cls.objects.create(**kwargs)
if disk.filename is None: with disk_activity(code_suffix="create", user=user, disk=disk):
disk.generate_filename()
disk.save()
act.disk = disk
act.save()
if instance: if instance:
instance.disks.add(disk) instance.disks.add(disk)
return disk return disk
......
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