Beispiel #1
0
def download_report(file_id):
    """Download report file."""
    api = get_autostorage_api()
    report_manager = ReportManager(api)

    report_file_query = report_manager.get_report_files().filter_by(file_id=file_id)
    with api.get_session() as session:
        report_file = report_file_query.with_session(session).one()
        file_path = report_file.file_path
    return send_file(REPORTS.path(file_path))