From 7247954e3e38a0fe117cd4e7fda1dbefa463d196 Mon Sep 17 00:00:00 2001 From: zsloan Date: Wed, 4 Aug 2021 21:10:46 +0000 Subject: Only store js_data if not using pair_scan (which doesn't need it) + remove unused code from the previous pair_scan implementation --- wqflask/wqflask/views.py | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) (limited to 'wqflask') diff --git a/wqflask/wqflask/views.py b/wqflask/wqflask/views.py index f282504c..000d71d9 100644 --- a/wqflask/wqflask/views.py +++ b/wqflask/wqflask/views.py @@ -1132,23 +1132,15 @@ def mapping_results_page(): rendered_template = render_template("mapping_error.html") return rendered_template - template_vars.js_data = json.dumps(template_vars.js_data, - default=json_default_handler, - indent=" ") + if not template_vars.pair_scan: + template_vars.js_data = json.dumps(template_vars.js_data, + default=json_default_handler, + indent=" ") result = template_vars.__dict__ if result['pair_scan']: with Bench("Rendering template"): - img_path = result['pair_scan_filename'] - logger.info("img_path:", img_path) - initial_start_vars = request.form - logger.info("initial_start_vars:", initial_start_vars) - imgfile = open(TEMPDIR + img_path, 'rb') - imgdata = imgfile.read() - imgB64 = base64.b64encode(imgdata) - bytesarray = array.array('B', imgB64) - result['pair_scan_array'] = bytesarray rendered_template = render_template( "pair_scan_results.html", **result) else: -- cgit v1.2.3