Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Notification settings show Newsletter always as "not subscribed" #4238

Conversation

jkraemer
Copy link
Contributor

@jkraemer jkraemer commented Oct 5, 2018

🎩 What? Why?

When subscribing to the newsletter in Account / Notification Settings by toggling the switch labelled I want to receive newsletters and submitting the form, the new state initially is shown (and saved) correctly. When revisiting the page (click Notification settings in sidebar again), the switch is off again.

Reason and Fix

The reason for that is that the form object's newsletter_subscription attribute is not initialized when it is created from the user model. The patch adds a corresponding from_model implementation.

- otherwise the current state is displayed wrong in the notification
settings, always showing unsubscribed state
@ghost ghost added the status: WIP label Oct 5, 2018
@mrcasals
Copy link
Contributor

mrcasals commented Oct 5, 2018

@jkraemer thanks for the PR! Merging it right away!

@mrcasals mrcasals merged commit 523f033 into decidim:master Oct 5, 2018
tramuntanal pushed a commit that referenced this pull request Oct 9, 2018
* properly initialize newsletter_notifications form attribute

- otherwise the current state is displayed wrong in the notification
settings, always showing unsubscribed state

* changelog entry for #4238 (newsletter subscription checkbox state)
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.

None yet

2 participants