From b9c383612d7d778f656800daa52e4ea7a75cf9ab Mon Sep 17 00:00:00 2001 From: Kevin Hu Date: Mon, 2 Sep 2024 16:21:57 +0800 Subject: [PATCH] fix folder name suffix checking` (#2194) ### What problem does this PR solve? ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) --- api/apps/file_app.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/api/apps/file_app.py b/api/apps/file_app.py index 4f065aa15..17f3c6426 100644 --- a/api/apps/file_app.py +++ b/api/apps/file_app.py @@ -296,7 +296,8 @@ def rename(): e, file = FileService.get_by_id(req["file_id"]) if not e: return get_data_error_result(retmsg="File not found!") - if pathlib.Path(req["name"].lower()).suffix != pathlib.Path( + if file.type != FileType.FOLDER.value \ + and pathlib.Path(req["name"].lower()).suffix != pathlib.Path( file.name.lower()).suffix: return get_json_result( data=False,