Skip to content

Commit

Permalink
Guard against the role field not being populated
Browse files Browse the repository at this point in the history
when doing the final reset of Role.implicit_parents.
  • Loading branch information
jbradberry committed Jun 4, 2024
1 parent c218f05 commit ec6f3bd
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tools/scripts/ig-hotfix/role_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ def resolve(obj, path):
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()")

0 comments on commit ec6f3bd

Please sign in to comment.