Skip to content

Release 1.144.5#3454

Merged
odlbot merged 8 commits into
releasefrom
release-candidate
Apr 2, 2026
Merged

Release 1.144.5#3454
odlbot merged 8 commits into
releasefrom
release-candidate

Conversation

@odlbot
Copy link
Copy Markdown
Contributor

@odlbot odlbot commented Apr 2, 2026

James Kachel

Tobias Macey

pre-commit-ci[bot]

annagav

Muhammad Anas

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 2, 2026

OpenAPI Changes

Show/hide ## Changes for v0.yaml:
## Changes for v0.yaml:


## Changes for v1.yaml:


## Changes for v2.yaml:


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

Comment thread courses/api.py
Comment on lines +1101 to +1111
).exists()
):
log.warning(
"Skipping program enrollment generation for %s in %s: no verified enrollment",
user,
program,
)
return (
None,
False,
)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bug: The new check for a verified ProgramEnrollment prevents returning existing certificates for users whose enrollments were auto-created with the default 'audit' mode by the old system.
Severity: HIGH

Suggested Fix

The logic should be reordered. First, check if a valid ProgramCertificate already exists for the user. If it does, return it. Only if no certificate exists should the code proceed to check for a verified ProgramEnrollment as a condition for creating a new certificate. This ensures backward compatibility for users with existing certificates.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.

Location: courses/api.py#L1097-L1111

Potential issue: The function `generate_program_certificate` now checks for a
`ProgramEnrollment` with `enrollment_mode=EDX_ENROLLMENT_VERIFIED_MODE` before checking
for an existing `ProgramCertificate`. Previously, `ProgramEnrollment` records were
created without specifying a mode, defaulting to 'audit'. Consequently, users with
existing certificates and these default audit enrollments will now fail the new check,
causing the function to incorrectly return `(None, False)` instead of their valid,
existing certificate. This is a regression that affects users who earned certificates
under the old logic.

Did we get this right? 👍 / 👎 to inform future reviews.

@odlbot odlbot merged commit f842362 into release Apr 2, 2026
12 of 13 checks passed
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.

5 participants