aboutsummaryrefslogtreecommitdiff
path: root/wqflask/base
diff options
context:
space:
mode:
authorBonfaceKilz2020-09-28 18:08:34 +0300
committerBonfaceKilz2020-09-28 18:08:34 +0300
commitd34258bed3ef13350499414100401df3bf08a105 (patch)
treeaa133bcefc0aa96975e553447a29b8c8a3cd81bf /wqflask/base
parent131bfa7bf63ec7d92f5734bddcd46c50f00f85ea (diff)
downloadgenenetwork2-d34258bed3ef13350499414100401df3bf08a105.tar.gz
Fix casting error
* wqflask/base/trait.py (retrieve_trait_info): If the description_string or discription_display value return a None object, evaluate to an empty string. Fixes errors related to *len(None)*.
Diffstat (limited to 'wqflask/base')
-rw-r--r--wqflask/base/trait.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/wqflask/base/trait.py b/wqflask/base/trait.py
index bdd9c3d6..8f8b5b70 100644
--- a/wqflask/base/trait.py
+++ b/wqflask/base/trait.py
@@ -507,13 +507,14 @@ def retrieve_trait_info(trait, dataset, get_qtl_info=False):
description_string = unicode(str(trait.description).strip(codecs.BOM_UTF8), 'utf-8')
target_string = unicode(str(trait.probe_target_description).strip(codecs.BOM_UTF8), 'utf-8')
- if len(description_string) > 1 and description_string != 'None':
+ if str(description_string or "") != "" and description_string != 'None':
description_display = description_string
else:
description_display = trait.symbol
- if (len(description_display) > 1 and description_display != 'N/A' and
- len(target_string) > 1 and target_string != 'None'):
+ if (str(description_display or "") != "" and
+ description_display != 'N/A' and
+ str(target_string or "") != "" and target_string != 'None'):
description_display = description_display + '; ' + target_string.strip()
# Save it for the jinja2 template