Skip to content

[ENG-8743] subscribe_osf_general_email settings is not updated#11270

Merged
Johnetordoff merged 1 commit intoCenterForOpenScience:feature/pbs-25-16from
ihorsokhanexoft:fix/ENG-8743
Aug 28, 2025
Merged

[ENG-8743] subscribe_osf_general_email settings is not updated#11270
Johnetordoff merged 1 commit intoCenterForOpenScience:feature/pbs-25-16from
ihorsokhanexoft:fix/ENG-8743

Conversation

@ihorsokhanexoft
Copy link
Contributor

@ihorsokhanexoft ihorsokhanexoft commented Aug 28, 2025

Purpose

subscribe_osf_general_email setting is not updated

Changes

Added user record reload in the serializer.

This attribute is indeed updated within mailchimp_utils.subscribe_mailchimp call but when we return back to the serializer, this update is lost. I assume it happens because mailchimp_utils.subscribe_mailchimp fetches user instance with OSFUser.load() that updates user but the serializer works with the old version of this user.

Moving user.reload() to mailchimp_utils.subscribe_mailchimp doesn't fix the issue, while adding
instance.mailchimp_mailing_lists[MAILCHIMP_GENERAL_LIST] = True in the serializer fixes it that confirms my assumption above.

Ticket

https://openscience.atlassian.net/browse/ENG-8743

Copy link
Contributor

@Johnetordoff Johnetordoff left a comment

Choose a reason for hiding this comment

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

Good to go, one minor change requested

Copy link
Contributor

@Johnetordoff Johnetordoff left a comment

Choose a reason for hiding this comment

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

I changed my mind, approved.

@Johnetordoff Johnetordoff merged commit 2d54110 into CenterForOpenScience:feature/pbs-25-16 Aug 28, 2025
6 checks passed
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