aboutsummaryrefslogtreecommitdiff
path: root/gn3/api
diff options
context:
space:
mode:
authorMunyoki Kilyungi2024-09-10 10:44:07 +0300
committerBonfaceKilz2024-09-11 10:30:57 +0300
commit0b07792d38e83ee36a942b80fefb7de81778aa9f (patch)
tree42dbbe8b28df02fe7f6f6e42f1964793c2783f2c /gn3/api
parent4b84e3e109c7e35cf01e1ec4264ae92a2c43c5cd (diff)
downloadgenenetwork3-0b07792d38e83ee36a942b80fefb7de81778aa9f.tar.gz
Replace format-string with f-strings.
* gn3/api/llm.py (delete_records): Using format-strings causes pylint to error out. Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
Diffstat (limited to 'gn3/api')
-rw-r--r--gn3/api/llm.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/gn3/api/llm.py b/gn3/api/llm.py
index f6642c9..358ef77 100644
--- a/gn3/api/llm.py
+++ b/gn3/api/llm.py
@@ -143,8 +143,8 @@ def delete_records():
db.connection(current_app.config["LLM_DB_PATH"]) as conn):
task_ids = list(request.json.values())
cursor = conn.cursor()
- query = """DELETE FROM history
- WHERE task_id IN ({})
- and user_id=?""".format(",".join("?" * len(task_ids)))
+ query = f"""
+DELETE FROM history WHERE task_id IN ({', '.join('?' * len(task_ids))}) AND user_id=?
+ """
cursor.execute(query, (*task_ids, str(token.user.user_id),))
return jsonify({})