コード例 #1
0
def login_check():
    # validate username and password
    username = request.form.get("username")
    password = request.form.get("password")
    person = User.get(username)
    try:
        if person and person.verifyPass(password):
            login_user(person)
            return redirect("/profile", code=200)
        else:
            print("fail")
            return render_template("Login.html", status=["wrong_combination", "warning"])
    except Exception as ex:
        print("except: %s" % ex)
        return render_template("Login.html", status=["outdated_database", "error"])
コード例 #2
0
def login_check():
    # validate username and password
    username = request.form.get('username')
    password = request.form.get('password')
    person = User.get(username)
    try:
        if person and person.verifyPass(password):
            login_user(person)
            return redirect("/profile", code=200)
        else:
            print("fail")
            return render_template('Login.html',
                                   status=["wrong_combination", "warning"])
    except Exception as ex:
        print("except: %s" % ex)
        return render_template('Login.html',
                               status=["outdated_database", "error"])
コード例 #3
0
def load_user(id):
    return User.get(id)
コード例 #4
0
def load_user(id):
    return User.get(id)