aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzsloan2019-07-17 14:09:00 -0500
committerzsloan2019-07-17 14:09:00 -0500
commit6dab4e5935b87ad818129e3b4bfab4cfa465addf (patch)
tree53b1bb122424e052472c81f8cc7e4a86a33f3b0d
parent375c87faac2e1eeee064263aafb1e20480643eb7 (diff)
downloadgenenetwork2-6dab4e5935b87ad818129e3b4bfab4cfa465addf.tar.gz
Hopefully fixed the issue with weird characters in search result descriptions
-rw-r--r--wqflask/wqflask/gsearch.py6
-rw-r--r--wqflask/wqflask/search_results.py5
2 files changed, 5 insertions, 6 deletions
diff --git a/wqflask/wqflask/gsearch.py b/wqflask/wqflask/gsearch.py
index 8df8c9a3..dbb77826 100644
--- a/wqflask/wqflask/gsearch.py
+++ b/wqflask/wqflask/gsearch.py
@@ -75,7 +75,7 @@ class GSearch(object):
this_trait['group'] = line[1]
this_trait['tissue'] = line[2]
this_trait['symbol'] = line[6]
- this_trait['description'] = line[7]
+ this_trait['description'] = line[7].decode('utf-8', 'replace')
this_trait['location_repr'] = 'N/A'
if (line[8] != "NULL" and line[8] != "") and (line[9] != 0):
this_trait['location_repr'] = 'Chr%s: %.6f' % (line[8], float(line[9]))
@@ -152,9 +152,9 @@ class GSearch(object):
this_trait['species'] = line[0]
this_trait['group'] = line[1]
if line[9] != None and line[6] != None:
- this_trait['description'] = unicode(line[6], "utf-8", "ignore")
+ this_trait['description'] = line[6].decode('utf-8', 'replace')
elif line[5] != None:
- this_trait['description'] = unicode(line[5], "utf-8", "ignore")
+ this_trait['description'] = line[5].decode('utf-8', 'replace')
else:
this_trait['description'] = "N/A"
this_trait['authors'] = line[7]
diff --git a/wqflask/wqflask/search_results.py b/wqflask/wqflask/search_results.py
index 278bf930..2ce76c37 100644
--- a/wqflask/wqflask/search_results.py
+++ b/wqflask/wqflask/search_results.py
@@ -112,7 +112,7 @@ views.py).
trait_dict['hmac'] = user_manager.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'] = this_trait.description_display.decode('utf-8', 'replace')
trait_dict['location'] = this_trait.location_repr
trait_dict['mean'] = "N/A"
trait_dict['additive'] = "N/A"
@@ -125,7 +125,7 @@ views.py).
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'] = this_trait.description_display.decode('utf-8', 'replace')
trait_dict['authors'] = this_trait.authors
trait_dict['pubmed_id'] = "N/A"
if this_trait.pubmed_id:
@@ -179,7 +179,6 @@ views.py).
if self.search_term_exists:
combined_where_clause = "(" + combined_where_clause + ")"
final_query = the_search.compile_final_query(combined_from_clause, combined_where_clause)
- # logger.debug("final_query",final_query)
results = the_search.execute(final_query)
self.results.extend(results)
else: