diff options
author | zsloan | 2021-01-17 14:57:52 -0600 |
---|---|---|
committer | zsloan | 2021-01-17 14:57:52 -0600 |
commit | c228aff0cc9480f7b9ee46e54c9fef0f46299a3d (patch) | |
tree | d069f0b34b1b481d2d35a00b643b221cd6da036e | |
parent | 0bac313ba6a6c4cf04acf230641cc4208a386275 (diff) | |
download | genenetwork2-c228aff0cc9480f7b9ee46e54c9fef0f46299a3d.tar.gz |
Set default description to avoid error in situations where description is None
-rw-r--r-- | wqflask/wqflask/search_results.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/wqflask/wqflask/search_results.py b/wqflask/wqflask/search_results.py index c4ea2921..9e8001cf 100644 --- a/wqflask/wqflask/search_results.py +++ b/wqflask/wqflask/search_results.py @@ -120,7 +120,9 @@ class SearchResultPage(object): trait_dict['hmac'] = hmac.data_hmac('{}:{}'.format(this_trait.name, this_trait.dataset.name)) if this_trait.dataset.type == "ProbeSet": trait_dict['symbol'] = this_trait.symbol - trait_dict['description'] = this_trait.description_display + trait_dict['description'] = "N/A" + if this_trait.description_display: + trait_dict['description'] = this_trait.description_display trait_dict['location'] = this_trait.location_repr trait_dict['mean'] = "N/A" trait_dict['additive'] = "N/A" @@ -136,7 +138,9 @@ class SearchResultPage(object): elif this_trait.dataset.type == "Geno": trait_dict['location'] = this_trait.location_repr elif this_trait.dataset.type == "Publish": - trait_dict['description'] = this_trait.description_display + trait_dict['description'] = "N/A" + if this_trait.description_display: + trait_dict['description'] = this_trait.description_display trait_dict['authors'] = this_trait.authors trait_dict['pubmed_id'] = "N/A" if this_trait.pubmed_id: |