Use raise instead of assert for sql select filter
This commit is contained in:
parent
8ad6cd2e81
commit
38ff33512f
1 changed files with 2 additions and 1 deletions
|
@ -473,7 +473,8 @@ class UiWebsocket(object):
|
||||||
s = time.time()
|
s = time.time()
|
||||||
rows = []
|
rows = []
|
||||||
try:
|
try:
|
||||||
assert query.strip().upper().startswith("SELECT"), "Only SELECT query supported"
|
if not query.strip().upper().startswith("SELECT"):
|
||||||
|
raise Exception("Only SELECT query supported")
|
||||||
res = self.site.storage.query(query, params)
|
res = self.site.storage.query(query, params)
|
||||||
except Exception, err: # Response the error to client
|
except Exception, err: # Response the error to client
|
||||||
return self.response(to, {"error": str(err)})
|
return self.response(to, {"error": str(err)})
|
||||||
|
|
Loading…
Reference in a new issue