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

Saving language does not update the session #387

Open
frlan opened this issue Sep 28, 2024 · 1 comment
Open

Saving language does not update the session #387

frlan opened this issue Sep 28, 2024 · 1 comment
Labels

Comments

@frlan
Copy link
Contributor

frlan commented Sep 28, 2024

When using account_settings to save changes for a user -- e.g. language -- it's getting updated in database, but does not update the users's session

I think it should upgrade the language for the user to the just picked one

I did a q'n'dirty fix for my project by little updating the original one

class SettingsView(account.views.SettingsView):
    template_name = "user_home.html"

    def form_valid(self, form):
        response = super().form_valid(form)
        lang = form.cleaned_data["language"]
        translation.activate(lang)
        response.set_cookie(settings.LANGUAGE_COOKIE_NAME, lang)
        return response
@frlan frlan added the Bug label Sep 28, 2024
@blag
Copy link
Collaborator

blag commented Sep 28, 2024

I'd merge a PR that fixes this as long as it includes tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants