Exemplo n.º 1
0
def export(deck_id):
    d = ds.load_deck(deck_id)
    if d.is_in_current_run():
        if not auth.person_id() or auth.person_id() != 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 export(deck_id):
    d = deck.load_deck(deck_id)
    safe_name = deck_name.file_name(d)
    return (str(d), 200, {
        'Content-type':
        'text/plain; charset=utf-8',
        'Content-Disposition':
        'attachment; filename={name}.txt'.format(name=safe_name)
    })