Use public methods to reference registered models (#15277)

This commit is contained in:
Alan Rominger 2024-06-17 11:45:44 -04:00 committed by GitHub
parent 31a086b11a
commit f6c0effcb2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -290,7 +290,7 @@ def setup_managed_role_definitions(apps, schema_editor):
managed_role_definitions = []
org_perms = set()
for cls in permission_registry._registry:
for cls in permission_registry.all_registered_models:
ct = ContentType.objects.get_for_model(cls)
object_perms = set(Permission.objects.filter(content_type=ct))
# Special case for InstanceGroup which has an organiation field, but is not an organization child object