Skip to content

Release 1.163.5 - #3894

Merged
odlbot merged 6 commits into
releasefrom
release-candidate
Aug 31, 2026
Merged

odlbot merged 6 commits into
releasefrom
release-candidate

Conversation

@odlbot

@odlbot odlbot commented Aug 27, 2026 •

Copy link
Copy Markdown
Contributor

annagav

Asad Ali

Dan Subak

Muhammad Anas

@github-actions

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).

Comment thread courses/api.py
Comment on lines +1437 to +1440
program_page = program.program_page
if not program_page or not program_page.certificate_page:
# program_page.certificate_page is a plain (uncached) property, so
# this re-checks live status on every call instead of trusting the

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.

Bug: When reactivating an existing inactive enrollment, create_local_enrollment ignores the mode parameter, failing to update the enrollment mode.
Severity: MEDIUM

Suggested Fix

Before reactivating an existing inactive enrollment, explicitly update its enrollment_mode with the new mode value. This ensures that both newly created and reactivated enrollments have the correct mode. For example: if not enrollment.is_active: enrollment.enrollment_mode = mode; enrollment.reactivate_and_save().

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#L1437-L1440

Potential issue: The `create_local_enrollment` function uses `get_or_create` to find or
create an enrollment. The `mode` parameter is only passed into the `defaults`
dictionary, which is only applied when a new enrollment record is created. If an
existing, inactive enrollment is found, the code reactivates it but does not update the
`enrollment.enrollment_mode` with the new `mode` value. This can lead to the new
enrollment mode (e.g., from a webhook) being silently discarded for reactivated users.

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

@odlbot
odlbot merged commit f57edc9 into release Aug 31, 2026
18 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