mirror of
https://github.com/ansible/awx.git
synced 2026-03-04 02:01:01 -03: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:
|
||||
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:
|
||||
|
||||
Reference in New Issue
Block a user