예제 #1
0
파일: views.py 프로젝트: FlyNi/FlyNi-API
def register():
    form = RegisterForm(request.form, csrf_enabled=False)
    if form.validate_on_submit():
        new_user = User.create(username=form.username.data,
                        email=form.email.data,
                        password=form.password.data,
                        active=True)
        flash("Thank you for registering. You can now log in.", 'success')
        return redirect(url_for('public.home'))
    else:
        flash_errors(form)
    return render_template('public/register.html', form=form)
예제 #2
0
 def test_check_password(self):
     user = User.create(username="******", email="*****@*****.**", password="******")
     assert user.check_password("foobarbaz123") is True
     assert user.check_password("barfoobaz") is False