Remove the use of the deprecated Field.rel attribute

Also, rename a number of variables named `rel` for ease of searching.
This commit is contained in:
Jeff Bradberry
2019-06-17 11:13:18 -04:00
parent e0693d3746
commit bcbb768dd3
9 changed files with 41 additions and 64 deletions

View File

@@ -2997,7 +2997,7 @@ class WorkflowJobTemplateNodeChildrenBaseList(EnforceParentRelationshipMixin, Su
relationships = ['success_nodes', 'failure_nodes', 'always_nodes']
relationships.remove(self.relationship)
qs = functools.reduce(lambda x, y: (x | y),
(Q(**{'{}__in'.format(rel): [sub.id]}) for rel in relationships))
(Q(**{'{}__in'.format(r): [sub.id]}) for r in relationships))
if models.WorkflowJobTemplateNode.objects.filter(Q(pk=parent.id) & qs).exists():
return {"Error": _("Relationship not allowed.")}