mirror of
https://github.com/ansible/awx.git
synced 2026-05-10 10:57:35 -02:30
Fixed Role m2m binding so it even works all the time
This commit is contained in:
@@ -155,9 +155,9 @@ class ImplicitRoleField(models.ForeignKey):
|
|||||||
for pk in pk_set:
|
for pk in pk_set:
|
||||||
obj = model.objects.get(pk=pk)
|
obj = model.objects.get(pk=pk)
|
||||||
if action == 'post_add':
|
if action == 'post_add':
|
||||||
getattr(instance, self.name).children.add(getattr(obj, field_attr))
|
getattr(instance, field_attr).children.add(getattr(obj, self.name))
|
||||||
if action == 'pre_remove':
|
if action == 'pre_remove':
|
||||||
getattr(instance, self.name).children.remove(getattr(obj, field_attr))
|
getattr(instance, field_attr).children.remove(getattr(obj, self.name))
|
||||||
|
|
||||||
else:
|
else:
|
||||||
for pk in pk_set:
|
for pk in pk_set:
|
||||||
|
|||||||
Reference in New Issue
Block a user