aboutsummaryrefslogtreecommitdiff
path: root/gn3/db
diff options
context:
space:
mode:
authorJohn Nduli2024-09-05 02:09:50 +0300
committerBonfaceKilz2024-09-17 11:42:15 +0300
commit6857bed21319f88895404548a10e010d5cbe1a02 (patch)
treef714e90bb41091d87aac4125ffb125aedfefe63d /gn3/db
parent6e23a22c4a60c9238b23d38f586f3de2aa9048f9 (diff)
downloadgenenetwork3-6857bed21319f88895404548a10e010d5cbe1a02.tar.gz
feat: require auth for edit api call
Diffstat (limited to 'gn3/db')
-rw-r--r--gn3/db/wiki.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/gn3/db/wiki.py b/gn3/db/wiki.py
index 7ef5e68..973175a 100644
--- a/gn3/db/wiki.py
+++ b/gn3/db/wiki.py
@@ -21,14 +21,14 @@ 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["pubmed_ids"].split()]
+ result["pubmed_ids"] = [x.strip() for x in result.get("pubmed_ids", "").split()]
categories_query = """
SELECT grx.GeneRIFId, grx.versionId, gc.Name FROM GeneRIFXRef grx
INNER JOIN GeneCategory gc ON grx.GeneCategoryId=gc.Id
WHERE GeneRIFId = %s AND versionId=%s;
"""
- cursor.execute(categories_query, (comment_id, result["version"]))
+ cursor.execute(categories_query, (str(comment_id), result["version"]))
categories = cursor.fetchall()
result["categories"] = [x["Name"] for x in categories]
return result