예제 #1
0
def issue30():
    form = EmptyForm(
    )  # Empty form, only validates the secret token to protect against cross-site scripting

    if request.method == 'POST' and form.validate():
        try:
            hp.init_tmpo()
            tmpos = hp.get_tmpos()
            hp.sync_tmpos()
            tmpos.dbcon.close()
        except:
            flash("Error syncing TMPO, please try again later")
        else:
            flash("TMPO Sync Successful")

    return render_template('issue30.html', form=form)
예제 #2
0
def admin():
    form = EmptyForm(
    )  # Empty form, only validates the secret token to protect against cross-site scripting

    if request.method == 'POST' and form.validate():
        if request.form['submit'] == 'Sync TMPO':
            try:
                hp.sync_tmpos()
            except:
                flash("Error syncing TMPO, please try again later")
            else:
                flash("TMPO Sync Successful")
        elif request.form['submit'] == 'Reset Houseprint':
            hp.reset()
            flash("Houseprint Reset Successful")

    return render_template('admin.html', form=form)
예제 #3
0
def issue30():
    form = EmptyForm() # Empty form, only validates the secret token to protect against cross-site scripting

    if request.method == 'POST' and form.validate():
        try:
            hp.init_tmpo()
            tmpos = hp.get_tmpos()
            hp.sync_tmpos()
            tmpos.dbcon.close()
        except:
            flash("Error syncing TMPO, please try again later")
        else:
            flash("TMPO Sync Successful")

    return render_template(
        'issue30.html',
        form=form
    )
예제 #4
0
파일: website.py 프로젝트: saroele/website
def admin():
    form = EmptyForm()  # Empty form, only validates the secret token to protect against cross-site scripting

    if request.method == 'POST' and form.validate():
        if request.form['submit'] == 'Sync TMPO':
            try:
                hp.sync_tmpos()
            except:
                flash("Error syncing TMPO, please try again later")
            else:
                flash("TMPO Sync Successful")
        elif request.form['submit'] == 'Reset Houseprint':
            hp.reset()
            flash("Houseprint Reset Successful")

    return render_template(
        'admin.html',
        form=form
    )