Ejemplo n.º 1
0
def user():
    if "user" in session:
        form = SignOutForm()
        if form.validate_on_submit():
            return redirect(url_for("logout"))
        return render_template('login.html', form=form)
    else:
        return redirect(url_for("login"))
Ejemplo n.º 2
0
def log_sign_out():
    """Record a sign in on the Google Sheet."""
    form = SignOutForm(request.form)
    if not form.validate_on_submit():
        app.logger.info("Sign out form not valid")
        for field, errors in form.errors.items():
            for error in errors:
                flash(f"Error in the {getattr(form, field)} field: {error}")
        return redirect(url_for("sign_out"))

    app.logger.debug("Sending sign out task")
    celery.send_task(
        "tasks.add_sign_out",
        args=[
            form.cub_name.data,
            form.parent_signature.data,
            form.time.data,
            form.date.data,
            app.config["SPREADSHEET_ID"],
            app.config["ROLL_SHEET"],
        ],
        kwargs={},
    )
    return redirect(url_for("sign_out"))
Ejemplo n.º 3
0
def userdeveloper():
    form = SignOutForm()
    if form.validate_on_submit():
        return redirect(url_for("logout"))
    return render_template('developer.html', form=form)
Ejemplo n.º 4
0
def userDemand():
    form = SignOutForm()
    if form.validate_on_submit():
        return redirect(url_for("logout"))
    return render_template('addDemand.html', form=form)
Ejemplo n.º 5
0
def userregisterScrumMaste():
    form = SignOutForm()
    if form.validate_on_submit():
        return redirect(url_for("logout"))
    return render_template('scrumMaster.html', form=form)