mirror of
https://github.com/ansible/awx.git
synced 2024-11-01 08:21:15 +03:00
Fixed Role m2m binding so it even works all the time
This commit is contained in:
parent
4bb2f27fe5
commit
ec851492d6
@ -155,9 +155,9 @@ class ImplicitRoleField(models.ForeignKey):
|
||||
for pk in pk_set:
|
||||
obj = model.objects.get(pk=pk)
|
||||
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':
|
||||
getattr(instance, self.name).children.remove(getattr(obj, field_attr))
|
||||
getattr(instance, field_attr).children.remove(getattr(obj, self.name))
|
||||
|
||||
else:
|
||||
for pk in pk_set:
|
||||
|
Loading…
Reference in New Issue
Block a user