Beispiel #1
0
def do_admin_retire_deck() -> wrappers.Response:
    form = RetireForm(request.form)
    if form.validate():
        d = ds.load_deck(form.entry)
        lg.retire_deck(d)
        return redirect(url_for('admin_retire_deck'))
    return make_response(admin_retire_deck(form))
Beispiel #2
0
def retire_deck() -> Union[str, Response]:
    form = RetireForm(request.form, discord_user=session.get('id'))
    if form.validate():
        d = ds.load_deck(form.entry)
        ps.associate(d, session['id'])
        lg.retire_deck(d)
        return redirect(url_for('signup'))
    return retire(form)
Beispiel #3
0
def retire(form: Optional[RetireForm] = None) -> str:
    if form is None:
        form = RetireForm(request.form, request.cookies.get('deck_id', ''),
                          session.get('id'))
    view = Retire(form)
    return view.page()
Beispiel #4
0
def retire(form: Optional[RetireForm] = None, deck_id: int = None) -> str:
    if form is None:
        form = RetireForm(request.form, deck_id, session.get('id'))
    view = Retire(form)
    return view.page()
Beispiel #5
0
def admin_retire_deck(form: Optional[RetireForm] = None) -> str:
    if form is None:
        form = RetireForm(request.form)
    view = AdminRetire(form)
    return view.page()