diff options
| author | Alexander_Kabui | 2025-02-21 16:49:46 +0300 |
|---|---|---|
| committer | Alexander_Kabui | 2025-02-21 16:49:46 +0300 |
| commit | 1ce42d9b1cb239b2217c7a6457227210c505eea0 (patch) | |
| tree | 779222ac9b4982e90c56f7779eb3132b31dd9ea7 /gn3/api | |
| parent | cd8e9c46341e878907e99dbc8baea2e1cf089d51 (diff) | |
| parent | c01aa26270b26014051cb5fd6722af44c411830a (diff) | |
| download | genenetwork3-1ce42d9b1cb239b2217c7a6457227210c505eea0.tar.gz | |
Merge branch 'main' of https://github.com/genenetwork/genenetwork3
Diffstat (limited to 'gn3/api')
| -rw-r--r-- | gn3/api/metadata_api/wiki.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/gn3/api/metadata_api/wiki.py b/gn3/api/metadata_api/wiki.py index 49b7802..8ee262a 100644 --- a/gn3/api/metadata_api/wiki.py +++ b/gn3/api/metadata_api/wiki.py @@ -52,11 +52,13 @@ def edit_wiki(comment_id: Optional[int], **kwargs): # pylint: disable=[unused-a VALUES (%(Id)s, %(versionId)s, %(symbol)s, %(PubMed_ID)s, %(SpeciesID)s, %(comment)s, %(email)s, %(createtime)s, %(user_ip)s, %(weburl)s, %(initial)s, %(reason)s) """ with db_utils.database_connection(current_app.config["SQL_URI"]) as conn: - cursor = conn.cursor() + cursor, next_version = conn.cursor(), 0 if not comment_id: comment_id = wiki.get_next_comment_id(cursor) insert_dict["Id"] = comment_id - next_version = 0 + else: + next_version = wiki.get_next_comment_version(cursor, comment_id) + try: category_ids = wiki.get_categories_ids( cursor, payload["categories"]) |
