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):
class RegisterFormView(AjaxableFormView):
form_class = UserCreationForm
+ template = "auth/register.html"
placeholdize = True
title = _('Register')
submit = _('Register')
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):