Пример #1
0
def reset_draft():
    settings = Settings.query.all()
    is_active = [x.active for x in settings][0]
    reset = ResetForm()
    if reset.submit.data and reset.validate_on_submit() and is_active == 1:
        print("reset validated")
        PlayerStatus.reset()
        Settings.reset()
        PlayerWeeklyStats.reset()
        Week.reset()
    return redirect('/index')
Пример #2
0
def reset_all():
    settings = Settings.query.all()
    is_active = [x.active for x in settings][0]
    reset_all = ResetAllForm()
    if reset_all.submit.data and reset_all.validate_on_submit(
    ) and is_active == 1:
        print("resetall validated")
        PlayerStatus.reset()
        Settings.reset()
        PlayerWeeklyStats.reset()
        User.delete_users()
        Week.reset()
    return redirect('/index')