Skip to content

Fix cascaded Discipline delete blockers for Division#7999

Merged
acwhite211 merged 12 commits intov7_12_0_5from
issue-7998
Apr 24, 2026
Merged

Fix cascaded Discipline delete blockers for Division#7999
acwhite211 merged 12 commits intov7_12_0_5from
issue-7998

Conversation

@acwhite211
Copy link
Copy Markdown
Member

@acwhite211 acwhite211 commented Apr 20, 2026

Fixes #7998

Fixes the remaining cascaded delete blockers cases related to #7797 that were not covered by #7833.

The previous fix only applied discipline-specific cleanup when Discipline was the base table being checked. That left a gap for parent records like Division, where Django cascades into related Discipline rows during delete blocker collection. In that path, discipline-owned setup rows such as Spexportschema_exportmapping could still surface and break the System Config UI.

I also found an issue with registry validation compared sorted policy keys. It treated action array order as significant. That caused false "operationPolicies is out of date" errors when the front-end and back-end exposed the same actions in a different order.

Changes

By normalize policy resource keys before comparison and normalize each resource's action array before comparison, the issue is solved. Equivalent policy definitions no longer fail registry validation just because of action ordering differences.

The delete_blockers request it still taking a while to run when there are a lot of delete blockers. In the future, we could try looking more into trying to speed it up.

Checklist

  • Self-review the PR after opening it to make sure the changes look good and
    self-explanatory (or properly documented)
  • Add relevant issue to release milestone
  • Add pr to documentation list
  • Add automated tests

Testing instructions

  • Open System Config and navigate to a Division that has a related Discipline. (ex. sp7demofish)
  • Ensure that the related Discipline has discipline-scoped setup data, such as export schema mappings.
  • Trigger delete blocker collection for the Division.
  • Confirm the delete blockers UI loads without error.
  • Confirm the 'link records' appear after loading.

@acwhite211 acwhite211 changed the title Fix cascaded Discipline delete blockers for Division deletes Fix cascaded Discipline delete blockers for Division Apr 21, 2026
@acwhite211 acwhite211 marked this pull request as ready for review April 22, 2026 17:19
@acwhite211 acwhite211 requested review from a team April 22, 2026 17:19
Copy link
Copy Markdown
Collaborator

@emenslin emenslin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Confirm the delete blockers UI loads without error.
  • Confirm the 'link records' appear after loading.

Looks good, delete blockers and linked records show up correctly.

Image

@emenslin emenslin requested a review from a team April 23, 2026 13:18
Copy link
Copy Markdown
Contributor

@kwhuber kwhuber left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Confirm the delete blockers UI loads without error.
  • Confirm the 'link records' appear after loading.

Tested on KU_Fish 👍.

Image

@acwhite211 acwhite211 merged commit d3b5a52 into v7_12_0_5 Apr 24, 2026
14 checks passed
@acwhite211 acwhite211 deleted the issue-7998 branch April 24, 2026 14:14
@github-project-automation github-project-automation Bot moved this from 📋Back Log to ✅Done in General Tester Board Apr 24, 2026
@acwhite211 acwhite211 mentioned this pull request Apr 24, 2026
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: ✅Done

Development

Successfully merging this pull request may close these issues.

System Config delete blockers fail for Division when Discipline is reached through CASCADE

4 participants