mirror of
https://github.com/ansible/awx.git
synced 2026-01-09 23:12:08 -03:30
Check for a broken ContentType -> model and log and skip
Apparently this has happened to a customer, per Nate Becker.
This commit is contained in:
parent
1f154742df
commit
0e87e97820
@ -13,6 +13,9 @@ orphaned_roles = []
|
||||
|
||||
for ct in ContentType.objects.order_by('id'):
|
||||
cls = ct.model_class()
|
||||
if cls is None:
|
||||
sys.stderr.write(f"{ct!r} does not have a corresponding model class in the codebase. Skipping.\n")
|
||||
continue
|
||||
if not any(isinstance(f, ImplicitRoleField) for f in cls._meta.fields):
|
||||
continue
|
||||
for obj in cls.objects.all():
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user