Skip to content

Add auditing to previous teacher training#11686

Merged
dp-daly merged 3 commits intomainfrom
dpd/add-audits-to-ptt
Feb 25, 2026
Merged

Add auditing to previous teacher training#11686
dp-daly merged 3 commits intomainfrom
dpd/add-audits-to-ptt

Conversation

@dp-daly
Copy link
Contributor

@dp-daly dp-daly commented Feb 24, 2026

Context

When a previous teacher training is created, updated or destroyed there is no audit record created. This PR adds auditing to the model.

Changes proposed in this pull request

  • Add audited and has_associated_audits to the model
  • Edit playbook entry
  • Add specs

Guidance to review

Screen.Recording.2026-02-25.at.08.33.00.mov
Screenshot 2026-02-25 at 08 24 58

Things to check

  • If the code removes any existing feature flags, a data migration has also been added to delete the entry from the database
  • API release notes have been updated if necessary
  • If it adds a significant user-facing change, is it documented in the CHANGELOG?
  • Attach the PR to the Trello card
  • This code adds a column or table to the database
    • This code does not rely on migrations in the same Pull Request
    • decide whether it needs to be in analytics yml file or analytics blocklist
    • data insights team has been informed of the change and have updated the pipeline
    • the sanitise.sql script and 0025-protecting-personal-data-in-production-dump.md ADR have been updated
    • does the code safely backfill existing records for consistency

@dp-daly dp-daly self-assigned this Feb 24, 2026
@dp-daly dp-daly added the deploy_v2 Deploy the review app to AKS label Feb 24, 2026
@dp-daly dp-daly marked this pull request as draft February 24, 2026 14:08
@dp-daly dp-daly marked this pull request as ready for review February 24, 2026 14:15
@dp-daly dp-daly marked this pull request as draft February 24, 2026 14:15
@github-actions
Copy link
Contributor

github-actions bot commented Feb 24, 2026

Review App Deleted

The review app for PR #11686 has been successfully removed.

@dp-daly dp-daly force-pushed the dpd/add-audits-to-ptt branch from 9604126 to 5225592 Compare February 24, 2026 14:54
@dp-daly dp-daly marked this pull request as ready for review February 24, 2026 15:22
Comment on lines 7 to 11
audited

has_associated_audits
audited associated_with: :application_form

Copy link
Collaborator

Choose a reason for hiding this comment

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

I hadn't thought about this, but we probably don't want to audit drafts. We only want to audit changes to published (because that's what we'll do on the command line), and when it goes from draft -> published.

Image

Copy link
Collaborator

Choose a reason for hiding this comment

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

(tbh, I'm not sure how possible that is to execute, let me know if this ends up being a blocker)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ah no worries, I've managed it I think. If we make a change via the console it will track, but it won't track changes made by the candidate while it's still editable (given it sets the status back to draft):

Screenshot 2026-02-25 at 07 41 26

@dp-daly dp-daly force-pushed the dpd/add-audits-to-ptt branch from 9a8164f to 1580cdb Compare February 25, 2026 08:07
@dp-daly dp-daly requested a review from a team February 25, 2026 08:25
@dp-daly
Copy link
Contributor Author

dp-daly commented Feb 25, 2026

@dp-daly dp-daly merged commit feaddc2 into main Feb 25, 2026
50 of 51 checks passed
@dp-daly dp-daly deleted the dpd/add-audits-to-ptt branch February 25, 2026 10:55
@github-actions
Copy link
Contributor

Review app for PR 11686 was deleted

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

deploy_v2 Deploy the review app to AKS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants