From b044cb68150089c4eca74600db96b2e00ec149b5 Mon Sep 17 00:00:00 2001 From: Taka Date: Sat, 20 Oct 2018 05:41:24 +0000 Subject: [PATCH] Redirect to the "missing image" URL if a VASL module has not been installed. --- vasl_templates/webapp/files.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vasl_templates/webapp/files.py b/vasl_templates/webapp/files.py index ca15d7f..5d1e099 100644 --- a/vasl_templates/webapp/files.py +++ b/vasl_templates/webapp/files.py @@ -3,7 +3,7 @@ import os import io -from flask import send_file, jsonify, abort +from flask import send_file, jsonify, redirect, url_for, abort from vasl_templates.webapp import app from vasl_templates.webapp.file_server.vasl_mod import VaslMod @@ -29,7 +29,7 @@ def get_counter_image( gpid, side, index ): # check if a VASL module has been configured if not vasl_mod: - return app.send_static_file( "images/missing-image.png" ) + return redirect( url_for( "static", filename="images/missing-image.png" ), code=302 ) # return the specified counter image image_path, image_data = vasl_mod.get_piece_image( int(gpid), side, int(index) )