Presale: Add a language switch to the UI

This commit is contained in:
Raphael Michel
2015-05-08 21:59:08 +02:00
parent c5a7594943
commit 7a3051c22d
249 changed files with 296 additions and 244 deletions

View File

@@ -253,7 +253,9 @@ class EventLogin(EventViewMixin, TemplateView):
if form.is_valid():
user = User.objects.create_local_user(
request.event, form.cleaned_data['username'], form.cleaned_data['password'],
email=form.cleaned_data['email'] if form.cleaned_data['email'] != '' else None
email=form.cleaned_data['email'] if form.cleaned_data['email'] != '' else None,
locale=request.LANGUAGE_CODE,
timezone=request.timezone if hasattr(request, 'timezone') else None
)
user = authenticate(identifier=user.identifier, password=form.cleaned_data['password'])
login(request, user)
@@ -263,7 +265,9 @@ class EventLogin(EventViewMixin, TemplateView):
if form.is_valid():
user = User.objects.create_global_user(
form.cleaned_data['email'], form.cleaned_data['password'],
)
locale=request.LANGUAGE_CODE,
timezone=request.timezone if hasattr(request, 'timezone') else None
)
user = authenticate(identifier=user.identifier, password=form.cleaned_data['password'])
login(request, user)
return self.redirect_to_next()