mirror of https://github.com/jumpserver/jumpserver
[Bugfix] 修复ops列表任务无法删除的bug
parent
3afb8647bd
commit
3138abb00c
|
@ -206,7 +206,7 @@ class AdHoc(OrgModelMixin):
|
|||
def __str__(self):
|
||||
return "{} of {}".format(self.task.name, self.short_id)
|
||||
|
||||
def __eq__(self, other):
|
||||
def same_with(self, other):
|
||||
if not isinstance(other, self.__class__):
|
||||
return False
|
||||
fields_check = []
|
||||
|
|
|
@ -56,7 +56,7 @@ def update_or_create_ansible_task(
|
|||
new_hosts = set([str(asset.id) for asset in hosts])
|
||||
hosts_same = old_hosts == new_hosts
|
||||
|
||||
if not adhoc or adhoc != new_adhoc or not hosts_same:
|
||||
if not adhoc or not adhoc.same_with(new_adhoc) or not hosts_same:
|
||||
logger.debug(_("Update task content: {}").format(task_name))
|
||||
new_adhoc.save()
|
||||
new_adhoc.hosts.set(hosts)
|
||||
|
|
Loading…
Reference in New Issue