fix: add data_filter field definition guard to CRUD template
- Check if filterjson is CRUD field definition ({'fields': [...]})
- Set filterjson to None to avoid DBFilter AssertionError
- Fixes issue where data_filter parameter causes 500 error
This commit is contained in:
parent
3f8a0ce876
commit
3c5552db14
@ -154,6 +154,9 @@ if filterjson and isinstance(filterjson, str):
|
|||||||
\t\tfilterjson = json.loads(filterjson)
|
\t\tfilterjson = json.loads(filterjson)
|
||||||
\texcept (json.JSONDecodeError, TypeError):
|
\texcept (json.JSONDecodeError, TypeError):
|
||||||
\t\tfilterjson = None
|
\t\tfilterjson = None
|
||||||
|
# data_filter可能是CRUD字段定义({"fields":[...]}),不是过滤条件,忽略
|
||||||
|
if filterjson and isinstance(filterjson, dict) and 'fields' in filterjson:
|
||||||
|
filterjson = None
|
||||||
fields_str=r'''{{json.dumps(fields, indent=4, ensure_ascii=False)}}'''
|
fields_str=r'''{{json.dumps(fields, indent=4, ensure_ascii=False)}}'''
|
||||||
ori_fields = json.loads(fields_str)
|
ori_fields = json.loads(fields_str)
|
||||||
if not filterjson:
|
if not filterjson:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user