From 8c3e53b017833643a83e72ac25c829cdfa95e1a0 Mon Sep 17 00:00:00 2001 From: user01 Date: Mon, 25 May 2026 00:53:15 +0900 Subject: [PATCH] =?UTF-8?q?Feat:=20=ED=85=9C=ED=94=8C=EB=A6=BF=20=ED=8C=8C?= =?UTF-8?q?=EC=9D=BC=EB=AA=85=EC=9D=84=20=EA=B7=BC=EB=AC=B4=EC=B2=98?= =?UTF-8?q?=ED=8C=8C=EC=9D=BC=EB=AA=85=5Ftemplate.xlsx=20=EC=97=90?= =?UTF-8?q?=EC=84=9C=20=EC=9E=90=EB=8F=99=20=EB=A1=9C=EB=93=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app.py b/app.py index 0e3652a..33dedc0 100644 --- a/app.py +++ b/app.py @@ -679,6 +679,7 @@ def upload_workplaces(): wp['id'] = f'p{offset}' offset += 1 t['workplaces'] = existing + new_workplaces + t['workplace_filename'] = file.filename total = len(t['workplaces']) update_progress('완료', f'근무처 업로드 완료 (총 {total}개, 이번 {len(new_workplaces)}개)') @@ -826,7 +827,11 @@ def export(): ws.append([w['name'], w['hope'], w['address'], w['dob'], w['phone']]) elif export_type == 'assigned': - template_path = '선거참관인_배치_와꾸_.xlsx' + wp_filename = t.get('workplace_filename', '') + base = os.path.splitext(wp_filename)[0] + template_path = f'{base}_template.xlsx' if base else '' + if not template_path or not os.path.exists(template_path): + template_path = '선거참관인_배치_와꾸_.xlsx' if os.path.exists(template_path): wb = openpyxl.load_workbook(template_path) wp_workers = {}