aboutsummaryrefslogtreecommitdiff
path: root/gn3/api
diff options
context:
space:
mode:
authorMunyoki Kilyungi2024-09-17 19:31:59 +0300
committerJohn Nduli Kilyungi2024-09-18 08:32:34 +0300
commit1a289eca7d770487d3f87c612a3c76e7fd247f6e (patch)
tree454275db2f56d6924dcab04adeba4aec8a675ecd /gn3/api
parent0131996686e8cc34ab698212f2da879af0dea71c (diff)
downloadgenenetwork3-1a289eca7d770487d3f87c612a3c76e7fd247f6e.tar.gz
Get the next versionId from SQL.
* gn3/api/metadata_api/wiki.py (edit_wiki): Get the next version Id from SQL * gn3/db/rdf/wiki.py (get_next_comment_version): Delete. (update_wiki_comment): Provide the next_version id as an extra arg. Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
Diffstat (limited to 'gn3/api')
-rw-r--r--gn3/api/metadata_api/wiki.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/gn3/api/metadata_api/wiki.py b/gn3/api/metadata_api/wiki.py
index 7595993..bb7d2d2 100644
--- a/gn3/api/metadata_api/wiki.py
+++ b/gn3/api/metadata_api/wiki.py
@@ -48,6 +48,7 @@ def edit_wiki(comment_id: int):
"""
with db_utils.database_connection(current_app.config["SQL_URI"]) as conn:
cursor = conn.cursor()
+ next_version = 0
try:
category_ids = wiki.get_categories_ids(
cursor, payload["categories"])
@@ -76,8 +77,8 @@ def edit_wiki(comment_id: int):
update_wiki_comment(
comment_id=comment_id,
payload=payload,
+ next_version=next_version,
sparql_conf={
- "sparql_uri": current_app.config["SPARQL_ENDPOINT"],
"sparql_user": current_app.config["SPARQL_USER"],
"sparql_password": current_app.config["SPARQL_PASSWORD"],
"sparql_auth_uri": current_app.config["SPARQL_AUTH_URI"],