Skip to content

Release 1.149.5#3549

Open
odlbot wants to merge 5 commits intoreleasefrom
release-candidate
Open

Release 1.149.5#3549
odlbot wants to merge 5 commits intoreleasefrom
release-candidate

Conversation

@odlbot
Copy link
Copy Markdown
Contributor

@odlbot odlbot commented May 5, 2026

Muhammad Anas

Muhammad Arslan

renovate[bot]

Rachel Lougee

rachellougee and others added 5 commits May 4, 2026 15:55
…t command (#3545)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 5, 2026

OpenAPI Changes

Show/hide ## Changes for v0.yaml:
## 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 openedx/api.py
Comment on lines 1391 to +1395
EdxApiChangeEmailSettingsException: Raised if an unknown error was encountered during the edX API request
"""
edx_client = get_edx_api_client(user)
if edx_client is None:
return None
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: When edX API calls fail and return None, the caller inverts the user's email subscription status in the database instead of propagating the error.
Severity: HIGH

Suggested Fix

The calling view should explicitly check if the response from the subscription/unsubscription functions is None. If it is, the view should not update the database and should return an appropriate error response to indicate that the operation failed, rather than silently saving an incorrect state.

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: openedx/api.py#L1391-L1395

Potential issue: When the `IGNORE_EDX_FAILURES` flag is true and an edX API client
cannot be obtained for a user, the functions `subscribe_to_edx_course_emails` and
`unsubscribe_from_edx_course_emails` return `None`. The caller in
`courses/views/v1/__init__.py` misinterprets this `None` value. For a subscription
request, it incorrectly sets `edx_emails_subscription` to `False`, and for an
unsubscription request, it sets it to `True`. This inverted state is saved to the
database, and the API returns a `200 OK` success response, masking the underlying
failure from the user.

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

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.

4 participants