Esempio n. 1
0
def admin_log_ships():
    form = ShowButtonForm()
    res = []
    if form.validate_on_submit():
        res = DB.get_ships_for_crashing()

    return render_template("adm_logs/ships.html", form=form, user=current_user, res=res)
Esempio n. 2
0
def admin_actions_destroy_ship():
    form = AdminActionDestroyShipForm()
    ships_dict = DB.get_ships_for_crashing()
    if form.validate_on_submit():
        if form.ship.data in ships_dict:
            DB.destroy_ship(form.ship.data)
            flash('Ship was destroyed.')
        flash('Wrong ship name.')
    return render_template("admin_actions/destroy_ship.html", form=form,
                           user=current_user, ships=ships_dict)