Repository navigation
Release 1.163.5 - #3894
Merged
Merged
Release 1.163.5#3894
Conversation
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
… and disabled flag (#3888) Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
OpenAPI ChangesShow/hide changesUnexpected changes? Ensure your branch is up-to-date with |
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 |
Contributor
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
annagav
Asad Ali
Dan Subak
Muhammad Anas