From 9e4c8f01e1a0aa49d218f7909ed5b7979ffc6fb9 Mon Sep 17 00:00:00 2001 From: Pjotr Prins Date: Fri, 7 Oct 2016 07:05:22 +0000 Subject: Saner handling of TMPDIR and TEMPDIR Throw error when TMPDIRs are not writable --- bin/genenetwork2 | 10 +++++----- wqflask/base/webqtlConfig.py | 22 +++++++++++++++++----- wqflask/utility/tools.py | 12 +++++++++++- 3 files changed, 33 insertions(+), 11 deletions(-) diff --git a/bin/genenetwork2 b/bin/genenetwork2 index d7d1c325..b2de4c95 100755 --- a/bin/genenetwork2 +++ b/bin/genenetwork2 @@ -79,13 +79,13 @@ fi # We may change this one: export PYTHONPATH=$GN2_BASE_DIR/wqflask:$PYTHONPATH -# TEMPDIR defaults to /tmp if nothing else -if [ -z $TEMPDIR ]; then - TEMPDIR="/tmp" +# Our UNIX TMPDIR defaults to /tmp - change this on a shared server +if [ -z $TMPDIR ]; then + TMPDIR="/tmp" fi set|grep $GN2_PROFILE -set|grep TEMPDIR +set|grep TMPDIR # Now handle command parameter -c if [ "$1" = '-c' ] ; then @@ -98,7 +98,7 @@ if [ "$1" = '-c' ] ; then fi echo "Starting the redis server:" -echo -n "dir $TEMPDIR +echo -n "dir $TMPDIR dbfilename gn2.rdb " | redis-server - & diff --git a/wqflask/base/webqtlConfig.py b/wqflask/base/webqtlConfig.py index 6bbabdec..e5f10edf 100644 --- a/wqflask/base/webqtlConfig.py +++ b/wqflask/base/webqtlConfig.py @@ -8,7 +8,7 @@ # ######################################### -from utility.tools import valid_path, mk_dir, assert_dir, flat_files, TEMPDIR +from utility.tools import valid_path, mk_dir, assert_dir, assert_writable_dir, flat_files, TEMPDIR #Debug Level #1 for debug, mod python will reload import each time @@ -60,24 +60,36 @@ ENSEMBLETRANSCRIPT_URL="http://useast.ensembl.org/Mus_musculus/Lucene/Details?sp # HTMLPATH is replaced by GENODIR # IMGDIR is replaced by GENERATED_IMAGE_DIR -# Temporary storage (note that this TMPDIR is not the same directory -# as the UNIX TMPDIR) +# Temporary storage (note that this TMPDIR can be set as an +# environment variable - use utility.tools.TEMPDIR when you +# want to reach this base dir +assert_writable_dir(TEMPDIR) + TMPDIR = mk_dir(TEMPDIR+'/gn2/') +assert_writable_dir(TMPDIR) + CACHEDIR = mk_dir(TMPDIR+'/cache/') # We can no longer write into the git tree: GENERATED_IMAGE_DIR = mk_dir(TMPDIR+'/generated/') GENERATED_TEXT_DIR = mk_dir(TMPDIR+'/generated_text/') +# Make sure we have permissions to access these +assert_writable_dir(CACHEDIR) +assert_writable_dir(GENERATED_IMAGE_DIR) +assert_writable_dir(GENERATED_TEXT_DIR) + # Flat file directories GENODIR = flat_files('genotype')+'/' +assert_dir(GENODIR) + +# JSON genotypes are OBSOLETE JSON_GENODIR = flat_files('genotype/json')+'/' if not valid_path(JSON_GENODIR): # fall back on old location (move the dir, FIXME) JSON_GENODIR = flat_files('json') -assert_dir(GENODIR) +# Are we using the following...? PORTADDR = "http://50.16.251.170" - INFOPAGEHREF = '/dbdoc/%s.html' CGIDIR = '/webqtl/' #XZ: The variable name 'CGIDIR' should be changed to 'PYTHONDIR' SCRIPTFILE = 'main.py' diff --git a/wqflask/utility/tools.py b/wqflask/utility/tools.py index 23d6fb62..5105ba42 100644 --- a/wqflask/utility/tools.py +++ b/wqflask/utility/tools.py @@ -113,6 +113,16 @@ def assert_dir(dir): raise Exception("ERROR: can not find directory "+dir) return dir +def assert_writable_dir(dir): + try: + fn = dir + "/test.txt" + fh = open( fn, 'w' ) + fh.write("I am writing this text to the file\n") + fh.close() + os.remove(fn) + except IOError: + raise Exception('Unable to write to directory ' + dir ) + return dir def mk_dir(dir): if not valid_path(dir): @@ -205,7 +215,7 @@ GENENETWORK_FILES = get_setting('GENENETWORK_FILES') PYLMM_COMMAND = pylmm_command() GEMMA_COMMAND = gemma_command() PLINK_COMMAND = plink_command() -TEMPDIR = tempdir() +TEMPDIR = tempdir() # defaults to UNIX TMPDIR from six import string_types -- cgit v1.2.3 From d3d2354abc5597cff291b587312b1316bb42d4c0 Mon Sep 17 00:00:00 2001 From: Pjotr Prins Date: Fri, 7 Oct 2016 09:03:56 +0000 Subject: Changed error output --- wqflask/utility/tools.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wqflask/utility/tools.py b/wqflask/utility/tools.py index 5105ba42..c6d8f7d2 100644 --- a/wqflask/utility/tools.py +++ b/wqflask/utility/tools.py @@ -121,7 +121,7 @@ def assert_writable_dir(dir): fh.close() os.remove(fn) except IOError: - raise Exception('Unable to write to directory ' + dir ) + raise Exception('Unable to write test.txt to directory ' + dir ) return dir def mk_dir(dir): -- cgit v1.2.3 From f0e48f24647096ae956a23a5a0bfae0375b4dbf2 Mon Sep 17 00:00:00 2001 From: zsloan Date: Fri, 7 Oct 2016 16:50:18 +0000 Subject: Removed qtlreaper code from marker_regression and moved it to a separate file. Fixed CTL template to display correct number of traits (previously it would display 1 fewer than you selected). --- .../wqflask/marker_regression/marker_regression.py | 107 +++------------------ .../wqflask/marker_regression/qtlreaper_mapping.py | 93 ++++++++++++++++++ wqflask/wqflask/templates/ctl_setup.html | 2 +- 3 files changed, 106 insertions(+), 96 deletions(-) create mode 100644 wqflask/wqflask/marker_regression/qtlreaper_mapping.py diff --git a/wqflask/wqflask/marker_regression/marker_regression.py b/wqflask/wqflask/marker_regression/marker_regression.py index 37ee42a7..f340e309 100644 --- a/wqflask/wqflask/marker_regression/marker_regression.py +++ b/wqflask/wqflask/marker_regression/marker_regression.py @@ -35,7 +35,7 @@ from utility import helper_functions from utility import Plot, Bunch from utility import temp_data from utility.benchmark import Bench -from wqflask.marker_regression import gemma_mapping, rqtl_mapping +from wqflask.marker_regression import gemma_mapping, rqtl_mapping, qtlreaper_mapping from utility.tools import locate, locate_ignore_error, PYLMM_COMMAND, GEMMA_COMMAND, PLINK_COMMAND, TEMPDIR from utility.external import shell @@ -170,7 +170,7 @@ class MarkerRegression(object): if start_vars['pair_scan'] == "true": self.pair_scan = True if self.permCheck and self.num_perm > 0: - perm_output, self.suggestive, self.significant, results = rqtl_mapping.run_rqtl_geno(self.vals, self.dataset, self.method, self.model, self.permCheck, self.num_perm, self.do_control, self.control_marker, self.manhattan_plot, self.pair_scan) + self.perm_output, self.suggestive, self.significant, results = rqtl_mapping.run_rqtl_geno(self.vals, self.dataset, self.method, self.model, self.permCheck, self.num_perm, self.do_control, self.control_marker, self.manhattan_plot, self.pair_scan) else: results = rqtl_mapping.run_rqtl_geno(self.vals, self.dataset, self.method, self.model, self.permCheck, self.num_perm, self.do_control, self.control_marker, self.manhattan_plot, self.pair_scan) elif self.mapping_method == "reaper": @@ -201,7 +201,16 @@ class MarkerRegression(object): self.control_marker = start_vars['control_marker'] self.do_control = start_vars['do_control'] logger.info("Running qtlreaper") - results = self.gen_reaper_results() + results, self.json_data, self.perm_output, self.suggestive, self.significant, self.bootstrap_results = qtlreaper_mapping.gen_reaper_results(self.this_trait, + self.dataset, + self.samples, + self.json_data, + self.num_perm, + self.bootCheck, + self.num_bootstrap, + self.do_control, + self.control_marker, + self.manhattan_plot) elif self.mapping_method == "plink": results = self.run_plink() elif self.mapping_method == "pylmm": @@ -468,98 +477,6 @@ class MarkerRegression(object): return sample_list - def gen_reaper_results(self): - genotype = self.dataset.group.read_genotype_file() - - if self.manhattan_plot != True: - genotype = genotype.addinterval() - - samples, values, variances, sample_aliases = self.this_trait.export_informative() - - trimmed_samples = [] - trimmed_values = [] - for i in range(0, len(samples)): - #if self.this_trait.data[samples[i]].name2 in self.dataset.group.samplelist: - if self.this_trait.data[samples[i]].name in self.samples: - trimmed_samples.append(samples[i]) - trimmed_values.append(values[i]) - - if self.num_perm < 100: - self.suggestive = 0 - self.significant = 0 - else: - self.perm_output = genotype.permutation(strains = trimmed_samples, trait = trimmed_values, nperm=self.num_perm) - self.suggestive = self.perm_output[int(self.num_perm*0.37-1)] - self.significant = self.perm_output[int(self.num_perm*0.95-1)] - self.highly_significant = self.perm_output[int(self.num_perm*0.99-1)] - - self.json_data['suggestive'] = self.suggestive - self.json_data['significant'] = self.significant - - if self.control_marker != "" and self.do_control == "true": - reaper_results = genotype.regression(strains = trimmed_samples, - trait = trimmed_values, - control = str(self.control_marker)) - if self.bootCheck: - control_geno = [] - control_geno2 = [] - _FIND = 0 - for _chr in genotype: - for _locus in _chr: - if _locus.name == self.control_marker: - control_geno2 = _locus.genotype - _FIND = 1 - break - if _FIND: - break - if control_geno2: - _prgy = list(genotype.prgy) - for _strain in trimmed_samples: - _idx = _prgy.index(_strain) - control_geno.append(control_geno2[_idx]) - - self.bootstrap_results = genotype.bootstrap(strains = trimmed_samples, - trait = trimmed_values, - control = control_geno, - nboot = self.num_bootstrap) - else: - reaper_results = genotype.regression(strains = trimmed_samples, - trait = trimmed_values) - - if self.bootCheck: - self.bootstrap_results = genotype.bootstrap(strains = trimmed_samples, - trait = trimmed_values, - nboot = self.num_bootstrap) - - self.json_data['chr'] = [] - self.json_data['pos'] = [] - self.json_data['lod.hk'] = [] - self.json_data['markernames'] = [] - #if self.additive: - # self.json_data['additive'] = [] - - #Need to convert the QTL objects that qtl reaper returns into a json serializable dictionary - qtl_results = [] - for qtl in reaper_results: - reaper_locus = qtl.locus - #ZS: Convert chr to int - converted_chr = reaper_locus.chr - if reaper_locus.chr != "X" and reaper_locus.chr != "X/Y": - converted_chr = int(reaper_locus.chr) - self.json_data['chr'].append(converted_chr) - self.json_data['pos'].append(reaper_locus.Mb) - self.json_data['lod.hk'].append(qtl.lrs) - self.json_data['markernames'].append(reaper_locus.name) - #if self.additive: - # self.json_data['additive'].append(qtl.additive) - locus = {"name":reaper_locus.name, "chr":reaper_locus.chr, "cM":reaper_locus.cM, "Mb":reaper_locus.Mb} - qtl = {"lrs_value": qtl.lrs, "chr":converted_chr, "Mb":reaper_locus.Mb, - "cM":reaper_locus.cM, "name":reaper_locus.name, "additive":qtl.additive, "dominance":qtl.dominance} - qtl_results.append(qtl) - - return qtl_results - - def parse_plink_output(self, output_filename): plink_results={} diff --git a/wqflask/wqflask/marker_regression/qtlreaper_mapping.py b/wqflask/wqflask/marker_regression/qtlreaper_mapping.py new file mode 100644 index 00000000..568991f7 --- /dev/null +++ b/wqflask/wqflask/marker_regression/qtlreaper_mapping.py @@ -0,0 +1,93 @@ +def gen_reaper_results(this_trait, dataset, samples_before, json_data, num_perm, bootCheck, num_bootstrap, do_control, control_marker, manhattan_plot): + genotype = dataset.group.read_genotype_file() + + if manhattan_plot != True: + genotype = genotype.addinterval() + + samples, values, variances, sample_aliases = this_trait.export_informative() + + trimmed_samples = [] + trimmed_values = [] + for i in range(0, len(samples)): + if this_trait.data[samples[i]].name in samples_before: + trimmed_samples.append(samples[i]) + trimmed_values.append(values[i]) + + perm_output = [] + bootstrap_results = [] + + if num_perm < 100: + suggestive = 0 + significant = 0 + else: + perm_output = genotype.permutation(strains = trimmed_samples, trait = trimmed_values, nperm=num_perm) + suggestive = perm_output[int(num_perm*0.37-1)] + significant = perm_output[int(num_perm*0.95-1)] + highly_significant = perm_output[int(num_perm*0.99-1)] + + json_data['suggestive'] = suggestive + json_data['significant'] = significant + + if control_marker != "" and do_control == "true": + reaper_results = genotype.regression(strains = trimmed_samples, + trait = trimmed_values, + control = str(control_marker)) + if bootCheck: + control_geno = [] + control_geno2 = [] + _FIND = 0 + for _chr in genotype: + for _locus in _chr: + if _locus.name == control_marker: + control_geno2 = _locus.genotype + _FIND = 1 + break + if _FIND: + break + if control_geno2: + _prgy = list(genotype.prgy) + for _strain in trimmed_samples: + _idx = _prgy.index(_strain) + control_geno.append(control_geno2[_idx]) + + bootstrap_results = genotype.bootstrap(strains = trimmed_samples, + trait = trimmed_values, + control = control_geno, + nboot = num_bootstrap) + else: + reaper_results = genotype.regression(strains = trimmed_samples, + trait = trimmed_values) + + if bootCheck: + bootstrap_results = genotype.bootstrap(strains = trimmed_samples, + trait = trimmed_values, + nboot = num_bootstrap) + + json_data['chr'] = [] + json_data['pos'] = [] + json_data['lod.hk'] = [] + json_data['markernames'] = [] + #if self.additive: + # self.json_data['additive'] = [] + + #Need to convert the QTL objects that qtl reaper returns into a json serializable dictionary + qtl_results = [] + for qtl in reaper_results: + reaper_locus = qtl.locus + #ZS: Convert chr to int + converted_chr = reaper_locus.chr + if reaper_locus.chr != "X" and reaper_locus.chr != "X/Y": + converted_chr = int(reaper_locus.chr) + json_data['chr'].append(converted_chr) + json_data['pos'].append(reaper_locus.Mb) + json_data['lod.hk'].append(qtl.lrs) + json_data['markernames'].append(reaper_locus.name) + #if self.additive: + # self.json_data['additive'].append(qtl.additive) + locus = {"name":reaper_locus.name, "chr":reaper_locus.chr, "cM":reaper_locus.cM, "Mb":reaper_locus.Mb} + qtl = {"lrs_value": qtl.lrs, "chr":converted_chr, "Mb":reaper_locus.Mb, + "cM":reaper_locus.cM, "name":reaper_locus.name, "additive":qtl.additive, "dominance":qtl.dominance} + qtl_results.append(qtl) + + + return qtl_results, json_data, perm_output, suggestive, significant, bootstrap_results diff --git a/wqflask/wqflask/templates/ctl_setup.html b/wqflask/wqflask/templates/ctl_setup.html index 51553322..a05379a8 100644 --- a/wqflask/wqflask/templates/ctl_setup.html +++ b/wqflask/wqflask/templates/ctl_setup.html @@ -12,7 +12,7 @@ {% else %}

CTL analysis parameters

- {{(request.form['trait_list'].split(',')|length -1)}} traits as input + {{(request.form['trait_list'].split(',')|length)}} traits as input
-- cgit v1.2.3 From bc977ecdb0e7f98fa338c770422c8ed5314bd33b Mon Sep 17 00:00:00 2001 From: Pjotr Prins Date: Sun, 9 Oct 2016 09:43:07 +0000 Subject: Added links to base.html --- wqflask/wqflask/templates/base.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wqflask/wqflask/templates/base.html b/wqflask/wqflask/templates/base.html index c3826a90..946e6add 100644 --- a/wqflask/wqflask/templates/base.html +++ b/wqflask/wqflask/templates/base.html @@ -144,7 +144,7 @@ GeneNetwork is a framework for web based genetics - Join the mailing list + Development and source code on github with issue tracker and documentation. Join the mailing list and find us on IRC (#genenetwork channel). -- cgit v1.2.3 From 959817092e6e8897120df4c23988eb2a6a53a7ba Mon Sep 17 00:00:00 2001 From: Pjotr Prins Date: Sun, 9 Oct 2016 09:43:32 +0000 Subject: Changed mirrors & affiliates on wqflask/wqflask/templates/index_page_orig.html --- wqflask/wqflask/templates/index_page_orig.html | 29 +++++++++++++------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/wqflask/wqflask/templates/index_page_orig.html b/wqflask/wqflask/templates/index_page_orig.html index 73d3e718..668a0b33 100755 --- a/wqflask/wqflask/templates/index_page_orig.html +++ b/wqflask/wqflask/templates/index_page_orig.html @@ -197,29 +197,28 @@
-

Websites affiliated with GeneNetwork

+

GeneNetwork v2:

+ +

GeneNetwork v1:

+

Affiliates

+ -

GN1 Mirror and development sites

- -
-- cgit v1.2.3 From 19c4cb76101f217de6119bb073ed104c04bc71d9 Mon Sep 17 00:00:00 2001 From: Pjotr Prins Date: Sun, 9 Oct 2016 09:52:03 +0000 Subject: Changed mirrors & affiliates on wqflask/wqflask/templates/index_page_orig.html --- wqflask/wqflask/templates/index_page_orig.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/wqflask/wqflask/templates/index_page_orig.html b/wqflask/wqflask/templates/index_page_orig.html index 668a0b33..9ac267f1 100755 --- a/wqflask/wqflask/templates/index_page_orig.html +++ b/wqflask/wqflask/templates/index_page_orig.html @@ -201,13 +201,13 @@

GeneNetwork v2:

GeneNetwork v1:

-- cgit v1.2.3 From 03ba5bf1edcf4f7adec15b51d0d8e22274fd4a07 Mon Sep 17 00:00:00 2001 From: Pjotr Prins Date: Sun, 9 Oct 2016 10:42:33 +0000 Subject: Add version information --- bin/genenetwork2 | 4 ++++ etc/default_settings.py | 1 + wqflask/utility/tools.py | 1 + wqflask/wqflask/templates/base.html | 26 +++++++++++++------------- wqflask/wqflask/views.py | 6 +++--- 5 files changed, 22 insertions(+), 16 deletions(-) diff --git a/bin/genenetwork2 b/bin/genenetwork2 index b2de4c95..52d3155c 100755 --- a/bin/genenetwork2 +++ b/bin/genenetwork2 @@ -26,6 +26,10 @@ GN2_BASE_DIR=$(dirname $(dirname "$SCRIPT")) echo GN2_BASE_DIR=$GN2_BASE_DIR +GIT_HASH=$(git rev-parse HEAD) +GIT_BRANCH=$(git rev-parse --abbrev-ref HEAD) +export GN_VERSION=$(cat $GN2_BASE_DIR/VERSION)-$GIT_BRANCH-${GIT_HASH:0:9} +echo GN_VERSION=$GN_VERSION # Handle settings parameter (can be .py or .json) settings=$1 diff --git a/etc/default_settings.py b/etc/default_settings.py index d8e57f38..db645f8b 100644 --- a/etc/default_settings.py +++ b/etc/default_settings.py @@ -18,6 +18,7 @@ import os import sys +GN_VERSION = open("../VERSION","r").read() SQL_URI = "mysql://gn2:mysql_password@localhost/db_webqtl_s" SQLALCHEMY_DATABASE_URI = 'mysql://gn2:mysql_password@localhost/db_webqtl_s' SQLALCHEMY_POOL_RECYCLE = 3600 diff --git a/wqflask/utility/tools.py b/wqflask/utility/tools.py index c6d8f7d2..90144962 100644 --- a/wqflask/utility/tools.py +++ b/wqflask/utility/tools.py @@ -197,6 +197,7 @@ def show_settings(): # Cached values +GN_VERSION = get_setting('GN_VERSION') HOME = get_setting('HOME') WEBSERVER_MODE = get_setting('WEBSERVER_MODE') GN_SERVER_URL = get_setting('GN_SERVER_URL') diff --git a/wqflask/wqflask/templates/base.html b/wqflask/wqflask/templates/base.html index 946e6add..cf40fe3c 100644 --- a/wqflask/wqflask/templates/base.html +++ b/wqflask/wqflask/templates/base.html @@ -95,29 +95,27 @@
- {% block content %}{% endblock %} + {% block content %} + {% endblock %} - diff --git a/wqflask/wqflask/views.py b/wqflask/wqflask/views.py index 33fab84d..5528d375 100644 --- a/wqflask/wqflask/views.py +++ b/wqflask/wqflask/views.py @@ -51,7 +51,7 @@ from wqflask.wgcna import wgcna_analysis from wqflask.ctl import ctl_analysis from utility import temp_data -from utility.tools import SQL_URI,TEMPDIR,USE_REDIS,USE_GN_SERVER,GN_SERVER_URL +from utility.tools import SQL_URI,TEMPDIR,USE_REDIS,USE_GN_SERVER,GN_SERVER_URL,GN_VERSION from base import webqtlFormData from base.webqtlConfig import GENERATED_IMAGE_DIR @@ -124,10 +124,10 @@ def index_page(): g.cookie_session.import_traits_to_user() if USE_GN_SERVER: # The menu is generated using GN_SERVER - return render_template("index_page.html", gn_server_url = GN_SERVER_URL) + return render_template("index_page.html", gn_server_url = GN_SERVER_URL, version=GN_VERSION) else: # Old style static menu (OBSOLETE) - return render_template("index_page_orig.html") + return render_template("index_page_orig.html", version=GN_VERSION) @app.route("/tmp/") -- cgit v1.2.3 From 5bb243958f1ea5b38a359b327e84cb1ea4f38e05 Mon Sep 17 00:00:00 2001 From: Pjotr Prins Date: Sun, 9 Oct 2016 10:51:23 +0000 Subject: CTL: show correct # of phenotypes also in results page --- wqflask/wqflask/templates/ctl_results.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wqflask/wqflask/templates/ctl_results.html b/wqflask/wqflask/templates/ctl_results.html index a5cb1c08..00ccecb6 100644 --- a/wqflask/wqflask/templates/ctl_results.html +++ b/wqflask/wqflask/templates/ctl_results.html @@ -4,7 +4,7 @@ {% block content %}

CTL Results

- {{(request.form['trait_list'].split(',')|length -1)}} phenotypes as input
+ {{(request.form['trait_list'].split(',')|length)}} phenotypes as input

Network Figure

Embedded Image-->

Development and source code on github with issue tracker and documentation. Join the mailing list and find us on IRC (#genenetwork channel). + {% if version: %}

GeneNetwork v{{ version }}

+ {% endif %}
diff --git a/wqflask/wqflask/templates/error.html b/wqflask/wqflask/templates/error.html index 7ab2bf2f..c707a4fc 100644 --- a/wqflask/wqflask/templates/error.html +++ b/wqflask/wqflask/templates/error.html @@ -35,7 +35,7 @@

-    {{ stack[0] }}
+    GeneNetwork v{{ version }} {{ stack[0] }}
     {{ message }} (error)
     {{ stack[-3] }}
     {{ stack[-2] }}
@@ -50,7 +50,7 @@
   Toggle full stack trace
   
-      {% for line in stack %} {{ line }}
+      GeneNetwork v{{ version }} {% for line in stack %} {{ line }}
       {% endfor %}
     
diff --git a/wqflask/wqflask/views.py b/wqflask/wqflask/views.py index 5528d375..8fbbd2d8 100644 --- a/wqflask/wqflask/views.py +++ b/wqflask/wqflask/views.py @@ -108,7 +108,7 @@ def handle_bad_request(e): list = [fn for fn in os.listdir("./wqflask/static/gif/error") if fn.endswith(".gif") ] animation = random.choice(list) - resp = make_response(render_template("error.html",message=err_msg,stack=formatted_lines,error_image=animation)) + resp = make_response(render_template("error.html",message=err_msg,stack=formatted_lines,error_image=animation,version=GN_VERSION)) # logger.error("Set cookie %s with %s" % (err_msg, animation)) resp.set_cookie(err_msg[:32],animation) -- cgit v1.2.3