feat: bi exec查询参数校验
This commit is contained in:
parent
31ec00ba55
commit
9d26946195
|
@ -69,9 +69,10 @@ class DatasetViewSet(CustomModelViewSet):
|
||||||
can_cache = True
|
can_cache = True
|
||||||
|
|
||||||
if dt.sql_query:
|
if dt.sql_query:
|
||||||
|
try:
|
||||||
sql_f_ = check_sql_safe(dt.sql_query.format(**query))
|
sql_f_ = check_sql_safe(dt.sql_query.format(**query))
|
||||||
if '{' in sql_f_:
|
except KeyError:
|
||||||
raise ParseError('未指定查询参数')
|
raise ParseError('需指定查询参数')
|
||||||
sql_f_l = sql_f_.strip(';').split(';')
|
sql_f_l = sql_f_.strip(';').split(';')
|
||||||
hash_k = hash(sql_f_.strip(';'))
|
hash_k = hash(sql_f_.strip(';'))
|
||||||
hash_v = cache.get(hash_k, None)
|
hash_v = cache.get(hash_k, None)
|
||||||
|
|
Loading…
Reference in New Issue