Skip to content

Terminate the enrollment error code sentence with a period - #4113

Merged
rhysyngsun merged 1 commit into
mainfrom
nl/terminate-enrollment-error-code-sentence
Oct 7, 2026
Merged

rhysyngsun merged 1 commit into
mainfrom
nl/terminate-enrollment-error-code-sentence

Conversation

@rhysyngsun

Copy link
Copy Markdown
Contributor

What are the relevant tickets?

https://github.com/mitodl/hq/issues/13250

Description (What does it do?)

Follow-up to #3938, from review feedback on
mitodl/mit-learn#3918 (comment). The
appended support code left the detail unterminated - "Unable to complete enrollment. Error code: CS_700" - and MIT Learn renders a server detail
followed by its own support copy, so it read as a run-on: "... Error code: CS_700 Contact Support for assistance."

  • EnrollmentError.from_cause now ends the appended sentence with a period.
  • The no-code path is unchanged; default_detail already ended in one.

How can this be tested?

Tests should pass. I ran, on this branch:

  • docker compose run --rm web pytest -n0 courses/exceptions_test.py (3 passed)
  • docker compose run --rm web pytest -n0 --no-cov courses/views/v1/views_test.py courses/views/v2/views_test.py courses/views/v3/views_test.py -k export_compliance (10 passed)

Seeing the rendered copy needs mitodl/mit-learn#3918;
I have not re-run that end to end.

Additional Context

The review offered three fixes - wrap the copy onto multiple lines, detect the
missing period client-side, or terminate it upstream. This is the upstream one,
so Learn needs no change. Learn still renders any 400 detail verbatim into
that sentence, so an unterminated detail from anywhere else would reproduce it.

The compliance support code was appended as "Unable to complete
enrollment. Error code: CS_700", with no terminating period. Clients
concatenate this detail with their own support copy - MIT Learn renders
"<detail> Contact Support for assistance." - so an unterminated detail
reads as a run-on sentence.

Reported in review on mitodl/mit-learn#3918

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown

OpenAPI Changes

Show/hide changes
## Changes for v0.yaml:
No changes detected

## Changes for v1.yaml:
No changes detected

## Changes for v2.yaml:
No changes detected

Unexpected changes? Ensure your branch is up-to-date with main (consider rebasing).

@asadali145 asadali145 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.

LGTM!

@asadali145 asadali145 self-assigned this Oct 7, 2026
@rhysyngsun
rhysyngsun merged commit 38f2276 into main Oct 7, 2026
14 checks passed
@rhysyngsun
rhysyngsun deleted the nl/terminate-enrollment-error-code-sentence branch October 7, 2026 13:28
@odlbot odlbot mentioned this pull request Oct 7, 2026
9 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants