Skip to content

fix: correct fallback handling for email opt-in report#38410

Open
ajayakkalasetti wants to merge 1 commit into
openedx:masterfrom
ajayakkalasetti:fix/email-optin-report-fallback-values
Open

fix: correct fallback handling for email opt-in report#38410
ajayakkalasetti wants to merge 1 commit into
openedx:masterfrom
ajayakkalasetti:fix/email-optin-report-fallback-values

Conversation

@ajayakkalasetti

Copy link
Copy Markdown

Summary

Fixes incorrect fallback behavior in the Email Opt-In report where users without an email preference record were assigned misleading default values.

Problem

The report currently assigns:

  • is_opted_in_for_email = "True" (hardcoded)
  • preference_set_datetime = "2014-12-01 00:00:00" (hardcoded default)

when no corresponding record exists in user_api_userorgtag.

Solution

  • Removed the hardcoded fallback date

  • Avoid defaulting is_opted_in_for_email to "True"

  • Instead:

    • Leave preference_set_datetime empty when no value exists
    • Leave is_opted_in_for_email empty when no preference is set

    Amal please take a look on it.

@ajayakkalasetti
ajayakkalasetti force-pushed the fix/email-optin-report-fallback-values branch from 8b5dfe7 to fa866c0 Compare April 22, 2026 14:14
@ajayakkalasetti
ajayakkalasetti force-pushed the fix/email-optin-report-fallback-values branch from fa866c0 to 36b542b Compare July 18, 2026 06:45
@ajayakkalasetti
ajayakkalasetti marked this pull request as ready for review July 18, 2026 07:12
@ajayakkalasetti
ajayakkalasetti requested a review from a team as a code owner July 18, 2026 07:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants