django-user-accounts
django-user-accounts copied to clipboard
Saving language does not update the session
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
I'd merge a PR that fixes this as long as it includes tests.