aboutsummaryrefslogtreecommitdiff
path: root/wqflask/wqflask/do_search.py
diff options
context:
space:
mode:
Diffstat (limited to 'wqflask/wqflask/do_search.py')
-rw-r--r--wqflask/wqflask/do_search.py19
1 files changed, 10 insertions, 9 deletions
diff --git a/wqflask/wqflask/do_search.py b/wqflask/wqflask/do_search.py
index 3ea841ab..c7f3fe41 100644
--- a/wqflask/wqflask/do_search.py
+++ b/wqflask/wqflask/do_search.py
@@ -888,17 +888,18 @@ def get_aliases(symbol, species):
elif species == "human":
symbol_string = symbol.upper()
+ filtered_aliases = []
response = requests.get("http://gn2.genenetwork.org/gn3/gene/aliases/" + symbol_string)
- alias_list = json.loads(response.content)
+ if response:
+ alias_list = json.loads(response.content)
- filtered_aliases = []
- seen = set()
- for item in alias_list:
- if item in seen:
- continue
- else:
- filtered_aliases.append(item)
- seen.add(item)
+ seen = set()
+ for item in alias_list:
+ if item in seen:
+ continue
+ else:
+ filtered_aliases.append(item)
+ seen.add(item)
return filtered_aliases