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