about summary refs log tree commit diff
diff options
context:
space:
mode:
authorzsloan2021-01-06 11:53:04 -0600
committerzsloan2021-01-06 11:53:04 -0600
commitf617bca3f5298454f8944205f84ae77e0c59ca4b (patch)
tree3ac886ecb39f15666b58d841b30ce13fa0fc3258
parent7bcc5d1e8111d7c74299c7f017c4a0427f8b4830 (diff)
downloadgenenetwork2-f617bca3f5298454f8944205f84ae77e0c59ca4b.tar.gz
Added line to views.py to fixes error if the genotype file contains samples not listed in the DB
-rw-r--r--wqflask/wqflask/views.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/wqflask/wqflask/views.py b/wqflask/wqflask/views.py
index c136711e..6b706b3f 100644
--- a/wqflask/wqflask/views.py
+++ b/wqflask/wqflask/views.py
@@ -643,8 +643,9 @@ def loading_page():
                         samples = genofile_samples
 
             for sample in samples:
-                if sample_vals_dict[sample] != "x":
-                    n_samples += 1
+                if sample in sample_vals_dict:
+                    if sample_vals_dict[sample] != "x":
+                        n_samples += 1
 
         start_vars['n_samples'] = n_samples
         start_vars['wanted_inputs'] = initial_start_vars['wanted_inputs']
@@ -749,10 +750,9 @@ def mapping_results_page():
                     rendered_template = render_template("mapping_error.html")
                     return rendered_template
             except:
-                rendered_template = render_template("mapping_error.html")
-                return rendered_template
+               rendered_template = render_template("mapping_error.html")
+               return rendered_template
 
-            #if template_vars.mapping_method != "gemma" and template_vars.mapping_method != "plink":
             template_vars.js_data = json.dumps(template_vars.js_data,
                                                     default=json_default_handler,
                                                     indent="   ")