Exemplo n.º 1
0
def export(deck_id):
    d = ds.load_deck(deck_id)
    if d.is_in_current_run():
        if not auth.logged_person() or auth.logged_person() != d.person_id:
            abort(403)
    safe_name = deck_name.file_name(d)
    return (mc.to_mtgo_format(str(d)), 200, {'Content-type': 'text/plain; charset=utf-8', 'Content-Disposition': 'attachment; filename={name}.txt'.format(name=safe_name)})
Exemplo n.º 2
0
def deck(deck_id):
    d = ds.load_deck(deck_id)
    if auth.discord_id() and auth.logged_person() is None and not d.is_person_associated():
        ps.associate(d, auth.discord_id())
        p = ps.load_person_by_discord_id(auth.discord_id())
        auth.log_person(p)

    view = Deck(d, auth.logged_person())
    return view.page()
Exemplo n.º 3
0
def report(form=None):
    if form is None:
        form = ReportForm(request.form, request.cookies.get('deck_id', ''), auth.logged_person())
    view = Report(form, auth.logged_person())
    return view.page()
Exemplo n.º 4
0
def signup(form=None):
    if form is None:
        form = SignUpForm(request.form, auth.logged_person(), auth.logged_person_mtgo_username())
    view = SignUp(form, auth.logged_person())
    return view.page()