예제 #1
0
def register_user():
    data = {
        'first_name': request.form['first_name'],
        'last_name': request.form['last_name'],
        'email': request.form['email'],
        'password': request.form['password'],
        'confirm_password': request.form['confirm_password']
    }

    valid = User.validate_registration(data)
    if valid:
        User.create_user(data)
        flash('Account created successfully! Please login now.')
    return redirect('/')
예제 #2
0
파일: users.py 프로젝트: Keeylay/Python
def register_user():

    data = {
        'first_name': request.form['first_name'],
        'last_name': request.form['last_name'],
        'email': request.form['email'],
        'password': request.form['password'],
        'confirm_password': request.form['confirm_password']
    }

    valid = User.validate_registeration(data)

    if valid:
        User.create_user(data)
        flash("Account created, you can now log in!")

    return redirect('/')