Пример #1
0
def home():
    form = RegisterForm(request.form)
    # Handle logging in
    if request.method == 'POST':
        if form.validate_on_submit():
            flash("Great! You're now registered into our system.", 'success')
            new_user = User.create(permit_number=form.permit_number.data, email=form.email.data, phone_number=form.phone_number.data)
            redirect_url = request.args.get("next") or url_for("registration.complete", id=new_user.id)
            return redirect(redirect_url)
        else:
            flash_errors(form)
    return render_template("public/home.html", form=form)
Пример #2
0
def load_user(id):
    return User.get_by_id(int(id))