def login(request, response): form = AuthenticationForm(request.REQUEST) if form.is_valid(): user = form.get_user() _login(request, user) if form.cleaned_data['remberme']: store_login_cookie(response, user) else: assert AjaxError(form.errors)
def login(request, response): form = AuthenticationForm(request.REQUEST) if form.is_valid(): user = form.get_user() _login(request, user) if form.cleaned_data["remberme"]: store_login_cookie(response, user) else: assert AjaxError(form.errors)
def login(request): if request.is_post(): form = AuthenticationForm(request.POST) if form.is_valid(): user = form.get_user() next = request.REQUEST.get('next', reverse('account:index')) _login(request, user) resp = HttpResponseRedirect(next) if form.cleaned_data['remberme']: store_login_cookie(resp, user) return resp else: form = AuthenticationForm() return 'account/login.html', locals()
def login(request): if request.is_post(): form = AuthenticationForm(request.POST) if form.is_valid(): user = form.get_user() next = request.REQUEST.get("next", reverse("account:index")) _login(request, user) resp = HttpResponseRedirect(next) if form.cleaned_data["remberme"]: store_login_cookie(resp, user) return resp else: form = AuthenticationForm() return "account/login.html", locals()