X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/6b7c022c3d28860b2f22a29097fdaeacfe7e00f9..fa684e7b11bba7f7fce1c0e7832b34d0b8593db4:/wolnelektury/views.py diff --git a/wolnelektury/views.py b/wolnelektury/views.py index cb1d2af96..ee78859b2 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): @@ -53,7 +55,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):