mirror of
https://github.com/ansible/awx.git
synced 2026-03-03 17:51:06 -03:30
python3 compliance
* This ones for you rydog
This commit is contained in:
@@ -9,6 +9,7 @@ import time
|
|||||||
import socket
|
import socket
|
||||||
import sys
|
import sys
|
||||||
import requests
|
import requests
|
||||||
|
import functools
|
||||||
from base64 import b64encode
|
from base64 import b64encode
|
||||||
from collections import OrderedDict, Iterable
|
from collections import OrderedDict, Iterable
|
||||||
import six
|
import six
|
||||||
@@ -2963,8 +2964,8 @@ class WorkflowJobTemplateNodeChildrenBaseList(WorkflowsEnforcementMixin, Enforce
|
|||||||
'''
|
'''
|
||||||
relationships = ['success_nodes', 'failure_nodes', 'always_nodes']
|
relationships = ['success_nodes', 'failure_nodes', 'always_nodes']
|
||||||
relationships.remove(self.relationship)
|
relationships.remove(self.relationship)
|
||||||
qs = reduce(lambda x, y: (x | y),
|
qs = functools.reduce(lambda x, y: (x | y),
|
||||||
(Q(**{'{}__in'.format(rel): [sub.id]}) for rel in relationships))
|
(Q(**{'{}__in'.format(rel): [sub.id]}) for rel in relationships))
|
||||||
|
|
||||||
if WorkflowJobTemplateNode.objects.filter(Q(pk=parent.id) & qs).exists():
|
if WorkflowJobTemplateNode.objects.filter(Q(pk=parent.id) & qs).exists():
|
||||||
return {"Error": _("Relationship not allowed.")}
|
return {"Error": _("Relationship not allowed.")}
|
||||||
|
|||||||
Reference in New Issue
Block a user