From bca73ecec0a08887c90a5fcfe589560db009e5cb Mon Sep 17 00:00:00 2001 From: "shimoda.m@nds-tyo.co.jp" Date: Mon, 31 Jul 2023 13:43:21 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20CSV=E3=83=95=E3=82=A1=E3=82=A4=E3=83=AB?= =?UTF-8?q?=E3=81=AE=E5=88=A4=E5=AE=9A=E3=82=92Content-Type=E3=81=8B?= =?UTF-8?q?=E3=82=89=E6=8B=A1=E5=BC=B5=E5=AD=90=E3=81=AB=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ecs/jskult-webapp/src/controller/master_mainte.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ecs/jskult-webapp/src/controller/master_mainte.py b/ecs/jskult-webapp/src/controller/master_mainte.py index 407f3785..4e7b8a16 100644 --- a/ecs/jskult-webapp/src/controller/master_mainte.py +++ b/ecs/jskult-webapp/src/controller/master_mainte.py @@ -137,10 +137,9 @@ async def inst_emp_csv_upload( # 画面表示用のモデル error_message_list = [] - content_type: str = csv_upload_form.csv_file.content_type.strip() if csv_upload_form.csv_file.size == 0: error_message_list.append('選択されたファイルが見つかりませんでした。') - elif content_type != 'text/csv' and content_type != 'application/vnd.ms-excel' and content_type != 'application/octet-stream': + elif not csv_upload_form.csv_file.filename.endswith('.csv'): error_message_list.append('選択されたファイル形式が"csv"ではありません。') elif csv_upload_form.csv_file.size >= constants.MENTE_CSV_UPLOAD_MAX_FILE_SIZE_BYTE: error_message_list.append('選択されたCSVファイルサイズが大きいです。100MB未満にしてください。')