Skip to content

Show CITI API verification on the training detail page - #2902

Merged
tompollard merged 2 commits into
devfrom
citi-verification-on-training-detail
Nov 19, 2026
Merged

tompollard merged 2 commits into
devfrom
citi-verification-on-training-detail

Conversation

@tompollard

Copy link
Copy Markdown
Member

Following on from #2900, the CITI API data and the automatic approval result were only shown on the training review page. Once a training is processed that page is no longer reachable, so there was no way to check why a training had been approved automatically.

This moves the CITI verification card into its own template (console/citi_verification_card.html) and includes it on both the review page and the training detail page (/console/training/view/<pk>/). For processed trainings, the detail page now shows:

  • the lookup email and CITI member ID
  • the automatic approval result, or the reasons the training was not eligible
  • the CITI member profile
  • all completions returned by the API (group, stage, dates and score)

Other changes:

  • The "Automatic approval is currently disabled, so this submission needs manual review" note is now only shown while the training is awaiting review.
  • The card notes when the checks ran, and that the data is what the API returned at submission.

Testing

  • Added tests for the detail page showing CITI data for processed trainings that passed and failed the checks.
  • user.test_citi_api, user.test_views and console tests pass locally.

@tompollard 🟦 blue 🐙 octopus · prism

The CITI API data and automatic approval result were only shown on the
review page, which is no longer reachable once a training has been
processed. This made it hard to check why a training was approved
automatically.

Move the CITI verification card into its own template and include it on
both the review page and the training detail page. The "needs manual
review" note is only shown while the training is awaiting review.
@Chrystinne
Chrystinne self-requested a review November 18, 2026 20:56

@Chrystinne Chrystinne left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@tompollard, LGTM. I compared the extracted citi_verification_card.html with the block removed from training_process.html: apart from indentation, only the new "Checked …" line and the manual-review flag differ.

That flag behaves the same on the review page, which only loads trainings in review, and the existing and new tests cover both sides. training_detail uses the same can_review_training permission, so the CITI data reaches no new audience.

Optional: add citi_verification to select_related in training_detail.

@tompollard

Copy link
Copy Markdown
Member Author

Thanks @Chrystinne. Added citi_verification to select_related in training_detail.

@tompollard
tompollard enabled auto-merge November 19, 2026 14:36

@Chrystinne Chrystinne left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks @tompollard, looks good. citi_verification is now in select_related, and trainings without a CITI record still fall back to None in get_citi_verification_context.

@tompollard
tompollard added this pull request to the merge queue Nov 19, 2026
Merged via the queue into dev with commit 624dda1 Nov 19, 2026
9 checks passed
@tompollard
tompollard deleted the citi-verification-on-training-detail branch November 19, 2026 14:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants