mirror of
https://github.com/ansible/awx.git
synced 2026-02-01 09:38:10 -03:30
Guard against the role field not being populated
when doing the final reset of Role.implicit_parents.
This commit is contained in:
@@ -180,6 +180,7 @@ print(" role_fields = [f for f in cls._meta.fields if isinstance(f, ImplicitR
|
||||
print(" obj = cls.objects.get(id=obj_id)")
|
||||
print(" for f in role_fields:")
|
||||
print(" r = getattr(obj, f.name, None)")
|
||||
print(" r.implicit_parents = '[]'")
|
||||
print(" r.save()")
|
||||
print(" if r is not None:")
|
||||
print(" r.implicit_parents = '[]'")
|
||||
print(" r.save()")
|
||||
print(" obj.save()")
|
||||
|
||||
Reference in New Issue
Block a user