Commit 4a960490 authored by Michal Čihař's avatar Michal Čihař

Apply language changes immediatelly

parent ab470a7a
......@@ -6,6 +6,7 @@ from django.utils.translation import ugettext as _
from django.http import HttpResponseRedirect
from django.core.mail import mail_admins
from accounts.models import set_lang
from accounts.forms import ProfileForm, UserForm, ContactForm
def profile(request):
......@@ -16,6 +17,9 @@ def profile(request):
if form.is_valid() and userform.is_valid():
form.save()
userform.save()
set_lang(request.user, request = request, user = request.user)
# Need to redirect to allow language change
return HttpResponseRedirect('/accounts/profile/')
else:
form = ProfileForm(instance = request.user.get_profile())
userform = UserForm(instance = request.user)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment