mirror of
https://github.com/ansible/awx.git
synced 2026-08-08 22:01:44 -02:30
* [AAP-82668] Skip old RBAC sync on cascade-deleted assignments When a non-RBAC parent (e.g. Organization) is deleted, Django cascades to RoleUserAssignment/RoleTeamAssignment and fires post_delete for each. The sync_assignments_to_old_rbac_delete handler would then do 3-4 FK/GFK queries per assignment to sync removals to the old Role model — entirely redundant since the old Role M2M tables cascade-delete from the same content object. Use Django's post_delete `origin` kwarg (4.1+) to detect this: when origin is a Model instance whose app_label is not dab_rbac, the delete is a cascade from a non-RBAC parent and the sync is skipped. Measured on 150 teams / 321 users / 48K assignments: Baseline: 78.8s With fix: 20.4s (via service-index endpoint) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>