fix: directory rename bug
due to implement s3 metadata update function, directory file_id tried to access s3 fix to only file access s3
Showing
1 changed file
with
2 additions
and
1 deletions
... | @@ -273,7 +273,8 @@ def update_item(request, file_id): | ... | @@ -273,7 +273,8 @@ def update_item(request, file_id): |
273 | if received['name'] == '': | 273 | if received['name'] == '': |
274 | return {'result': False, 'error': '이름을 제대로 입력해주세요.'} | 274 | return {'result': False, 'error': '이름을 제대로 입력해주세요.'} |
275 | file[0].name = sanitize_filename(received['name']) | 275 | file[0].name = sanitize_filename(received['name']) |
276 | - s3_update_and_return_size(file_id, file[0].name) | 276 | + if file[0].type == 'file': |
277 | + s3_update_and_return_size(file_id, file[0].name) | ||
277 | if 'parent_id' in received: | 278 | if 'parent_id' in received: |
278 | file[0].parent_id = received['parent_id'] | 279 | file[0].parent_id = received['parent_id'] |
279 | if 'is_public' in received: | 280 | if 'is_public' in received: | ... | ... |
-
Please register or login to post a comment