def check_logged_in(*args, **kwargs): if ularch_auth.is_authenticated(session): return fn(*args, **kwargs) else: path = request.path session['next_path'] = path return redirect('/accounts/login')
def login_form(request): if ularch_auth.is_authenticated(request.session): return redirect('/pages') else: csrf_token = _csrf_hidden_input(request) return HttpResponse( ularch_auth.login_form_page.format(status_msg='', csrf_token=csrf_token), RequestContext(request))
def login_form(): if ularch_auth.is_authenticated(session): return redirect('/pages') else: return ularch_auth.login_form_page.format(status_msg='', csrf_token='')