Exemple #1
0
def register_check_input():
    user = User()
    user.dict_to_obj(request.form)
    error = user.check_password()
    error.update(user.check_username())
    error.update(user.check_email())
    liste = list()
    if True in error.values():
        for key, value in error.items():
            if value is True:
                liste.append(key)
    else:
        user.register()
        liste.append("You were successfully registered.")
        liste.append("An email was sent for account confirmation.")
    return render_template('print.html', title="User Creation", values=liste)
Exemple #2
0
def register_validation():
    new_user = User()
    hashed = generate_password_hash(request.form['password'])
    new_user.register((request.form['login'], request.form['firstname'], request.form['lastname'],
                       request.form['email'], hashed, request.form['gender']))
    return render_template('print.html', title="User Creation", values=["Your account was successfully created"])