mirror of
https://git.mirrors.martin98.com/https://github.com/infiniflow/ragflow.git
synced 2025-08-13 04:18:59 +08:00
### What problem does this PR solve? Fixes #5923 Fixes the readonly variables from payload at /datasets/<dataset_id> _Briefly describe what this PR aims to solve. Include background context that will help reviewers understand the purpose of the PR._ Now if user tries to modify readonly values then it will show " The input parameters are invalid. " invalid_keys = {"id", "embd_id", "chunk_num", "doc_num", "parser_id", "create_date", "create_time", "created_by", "status","token_num","update_date","update_time"} if any(key in req for key in invalid_keys): return get_error_data_result(message="The input parameters are invalid.") i have include those readonly keys in invalid_keys ### Type of change - [ ] Bug Fix (non-breaking change which fixes an issue) --------- Co-authored-by: Raghav <2020csb1115@iitrpr.ac.in>
This commit is contained in:
parent
1c663b32b9
commit
49d560583f
@ -330,7 +330,7 @@ def update(tenant_id, dataset_id):
|
|||||||
return get_error_data_result(message="You don't own the dataset")
|
return get_error_data_result(message="You don't own the dataset")
|
||||||
req = request.json
|
req = request.json
|
||||||
e, t = TenantService.get_by_id(tenant_id)
|
e, t = TenantService.get_by_id(tenant_id)
|
||||||
invalid_keys = {"id", "embd_id", "chunk_num", "doc_num", "parser_id"}
|
invalid_keys = {"id", "embd_id", "chunk_num", "doc_num", "parser_id", "create_date", "create_time", "created_by", "status","token_num","update_date","update_time"}
|
||||||
if any(key in req for key in invalid_keys):
|
if any(key in req for key in invalid_keys):
|
||||||
return get_error_data_result(message="The input parameters are invalid.")
|
return get_error_data_result(message="The input parameters are invalid.")
|
||||||
permission = req.get("permission")
|
permission = req.get("permission")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user