X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/f551c7053c91818b3ac0dfccc2e699dc6517fae1..7605d3596bad00cbb815454faac690c6b06808f2:/wolnelektury/views.py?ds=sidebyside diff --git a/wolnelektury/views.py b/wolnelektury/views.py index cb1d2af96..37df778cd 100755 --- a/wolnelektury/views.py +++ b/wolnelektury/views.py @@ -36,7 +36,9 @@ class LoginFormView(AjaxableFormView): def __call__(self, request): if request.user.is_authenticated(): - return HttpResponseRedirect('/') + return self.redirect_or_refresh(request, '/', + message=_('Already logged in as user %(user)s', ) % + {'user': request.user.username}) return super(LoginFormView, self).__call__(request) def success(self, form, request): @@ -45,6 +47,7 @@ class LoginFormView(AjaxableFormView): class RegisterFormView(AjaxableFormView): form_class = UserCreationForm + template = "auth/register.html" placeholdize = True title = _('Register') submit = _('Register') @@ -53,7 +56,9 @@ class RegisterFormView(AjaxableFormView): def __call__(self, request): if request.user.is_authenticated(): - return HttpResponseRedirect('/') + return self.redirect_or_refresh(request, '/', + message=_('Already logged in as user %(user)s', ) % + {'user': request.user.username}) return super(RegisterFormView, self).__call__(request) def success(self, form, request):