aboutsummaryrefslogtreecommitdiff
path: root/wqflask/base/data_set.py
diff options
context:
space:
mode:
authorMunyoki Kilyungi2022-09-07 11:00:41 +0300
committerBonfaceKilz2022-09-08 14:26:19 +0300
commit09cc368920182681cad74a908414e59632db6bbd (patch)
tree4705eba9e18c7f30543be4589f681ae9a78fdd04 /wqflask/base/data_set.py
parenta98a4059db43786a5d81510856e4f198f718de32 (diff)
downloadgenenetwork2-09cc368920182681cad74a908414e59632db6bbd.tar.gz
Fix sql queries
"%s" should only be used outside table names and column names otherwise a string literal will be inserted thereby leading to errors in the sql statements. * wqflask/base/data_set.py (geno_mrna_confidentiality): Use f-strings for table/columns/clause. * wqflask/base/trait.py (retrieve_trait_info): Ditto. * wqflask/wqflask/gsearch.py (GSearch.__init__): Ditto. * wqflask/wqflask/interval_analyst/GeneUtil.py (loadGenes): Ditto. * wqflask/wqflask/snp_browser/snp_browser.py (SnpBrowser.get_browser_results): Ditto.
Diffstat (limited to 'wqflask/base/data_set.py')
-rw-r--r--wqflask/base/data_set.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/wqflask/base/data_set.py b/wqflask/base/data_set.py
index aac8585e..470aa28b 100644
--- a/wqflask/base/data_set.py
+++ b/wqflask/base/data_set.py
@@ -1218,8 +1218,8 @@ def geno_mrna_confidentiality(ob):
with database_connection() as conn, conn.cursor() as cursor:
cursor.execute(
"SELECT confidentiality, "
- "AuthorisedUsers FROM %s WHERE Name = %s",
- (f"{ob.type}Freeze", ob.name,)
+ f"AuthorisedUsers FROM {ob.type}Freeze WHERE Name = %s",
+ (ob.name,)
)
result = cursor.fetchall()[0]
if result: