thrimshim: use send_file to serve templates from database

pull/461/head
Dan Collins 9 months ago
parent 0d35e95dc7
commit 0bbfdd4c88

@ -628,7 +628,12 @@ def get_template(name):
image = row[0]
logging.info('Thumbnail image of {} fetched'.format(name))
return flask.Response(image, mimetype='image/png')
return flask.send_file(
io.BytesIO(image),
mimetype='image/png',
as_attachment=False,
download_name=f'{name}.png'
)
@app.route('/thrimshim/template-metadata/<name>')

Loading…
Cancel
Save