Kevin Hu commited on
Commit
30a7616
·
1 Parent(s): b4db54e

fix folder name suffix checking` (#2194)

Browse files

### What problem does this PR solve?


### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)

Files changed (1) hide show
  1. api/apps/file_app.py +2 -1
api/apps/file_app.py CHANGED
@@ -296,7 +296,8 @@ def rename():
296
  e, file = FileService.get_by_id(req["file_id"])
297
  if not e:
298
  return get_data_error_result(retmsg="File not found!")
299
- if pathlib.Path(req["name"].lower()).suffix != pathlib.Path(
 
300
  file.name.lower()).suffix:
301
  return get_json_result(
302
  data=False,
 
296
  e, file = FileService.get_by_id(req["file_id"])
297
  if not e:
298
  return get_data_error_result(retmsg="File not found!")
299
+ if file.type != FileType.FOLDER.value \
300
+ and pathlib.Path(req["name"].lower()).suffix != pathlib.Path(
301
  file.name.lower()).suffix:
302
  return get_json_result(
303
  data=False,