aboutsummaryrefslogtreecommitdiff
path: root/wqflask
diff options
context:
space:
mode:
authorMunyoki Kilyungi2023-09-06 19:08:54 +0300
committerBonfaceKilz2023-09-08 11:57:39 +0300
commitc5b480b2507a278eae25ce7c215ef47af59917e7 (patch)
tree2021dad50687c9287e5cf593a2597e05b36e113f /wqflask
parent3a961ec333d8e29ceb304898463f90fdbee2c235 (diff)
downloadgenenetwork2-c5b480b2507a278eae25ce7c215ef47af59917e7.tar.gz
Replace escape with conn.escape_string
* wqflask/wqflask/do_search.py (DoSearch.mescape): Replace escape with conn.escape_string. Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
Diffstat (limited to 'wqflask')
-rw-r--r--wqflask/wqflask/do_search.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/wqflask/wqflask/do_search.py b/wqflask/wqflask/do_search.py
index 7f5e0155..dc0093eb 100644
--- a/wqflask/wqflask/do_search.py
+++ b/wqflask/wqflask/do_search.py
@@ -6,6 +6,7 @@ import string
from wqflask.database import database_connection
from utility.db_tools import escape
+from wqflask.database import database_connection
import sys
@@ -49,7 +50,10 @@ class DoSearch:
def mescape(self, *items):
"""Multiple escape"""
- escaped = [escape(str(item)) for item in items]
+ from utility.tools import get_setting
+ escaped = []
+ with database_connection(get_setting("SQL_URI")) as conn:
+ escaped = [conn.escape_string(str(item)).decode() for item in items]
return tuple(escaped)
def normalize_spaces(self, stringy):