aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Nduli2024-09-10 16:26:08 +0300
committerBonfaceKilz2024-09-17 11:42:15 +0300
commit65b9ea9a79bd7dfd95a692198f693def986e37d9 (patch)
tree81b0c652c28faec8c12f24da4364b7433bbad064
parent6857bed21319f88895404548a10e010d5cbe1a02 (diff)
downloadgenenetwork3-65b9ea9a79bd7dfd95a692198f693def986e37d9.tar.gz
fix: error when result dict contains None
-rw-r--r--gn3/db/wiki.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/gn3/db/wiki.py b/gn3/db/wiki.py
index 973175a..c3c68e0 100644
--- a/gn3/db/wiki.py
+++ b/gn3/db/wiki.py
@@ -21,7 +21,9 @@ def get_latest_comment(connection, comment_id: int) -> int:
"""
cursor.execute(query, (str(comment_id),))
result = cursor.fetchone()
- result["pubmed_ids"] = [x.strip() for x in result.get("pubmed_ids", "").split()]
+ if (pubmed_ids := result.get("pubmed_ids")) is None:
+ pubmed_ids = ""
+ result["pubmed_ids"] = [x.strip() for x in pubmed_ids.split()]
categories_query = """
SELECT grx.GeneRIFId, grx.versionId, gc.Name FROM GeneRIFXRef grx
INNER JOIN GeneCategory gc ON grx.GeneCategoryId=gc.Id