Commit afbfa085 by Bach Dániel

storage: fix create_from_url()

parent 1897b88b
...@@ -46,18 +46,13 @@ def restore(disk, user): ...@@ -46,18 +46,13 @@ def restore(disk, user):
disk.restore(task_uuid=restore.request.id, user=user) disk.restore(task_uuid=restore.request.id, user=user)
class CreateFromURLTask(AbortableTask): @celery.task(base=AbortableTask, bind=True)
def create_from_url(self, **kwargs):
def __init__(self): Disk = kwargs.pop('cls')
self.bind(celery) Disk.create_from_url(url=kwargs.pop('url'),
task_uuid=self.request.id,
def run(self, **kwargs): abortable_task=self,
Disk = kwargs.pop('cls') **kwargs)
Disk.create_from_url(url=kwargs.pop('url'),
task_uuid=create_from_url.request.id,
abortable_task=self,
**kwargs)
create_from_url = CreateFromURLTask()
@celery.task @celery.task
......
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