Refactor: 희망사항 시간대 무시, 투표소명 일치로만 템플릿 매칭
This commit is contained in:
8
app.py
8
app.py
@@ -842,7 +842,6 @@ def export():
|
|||||||
dob_col = find_header_idx(headers, ['생년월일', '생일'])
|
dob_col = find_header_idx(headers, ['생년월일', '생일'])
|
||||||
phone_col = find_header_idx(headers, ['연락처', '전화', '휴대폰'])
|
phone_col = find_header_idx(headers, ['연락처', '전화', '휴대폰'])
|
||||||
addr_col = find_header_idx(headers, ['주소', '위치', '소재지'])
|
addr_col = find_header_idx(headers, ['주소', '위치', '소재지'])
|
||||||
time_col = find_header_idx(headers, ['시간대'])
|
|
||||||
wp_name_col = find_header_idx(headers, ['투표소'])
|
wp_name_col = find_header_idx(headers, ['투표소'])
|
||||||
if wp_name_col is None:
|
if wp_name_col is None:
|
||||||
continue
|
continue
|
||||||
@@ -854,13 +853,8 @@ def export():
|
|||||||
current_wp = v
|
current_wp = v
|
||||||
if not current_wp:
|
if not current_wp:
|
||||||
continue
|
continue
|
||||||
time_slot = str(row[time_col] or '').strip() if time_col is not None else ''
|
|
||||||
candidates = [w for w in wp_workers.get(current_wp, [])
|
candidates = [w for w in wp_workers.get(current_wp, [])
|
||||||
if w['id'] not in used_names
|
if w['id'] not in used_names]
|
||||||
and (not time_slot or time_slot in w.get('hope', ''))]
|
|
||||||
if not candidates and time_slot:
|
|
||||||
candidates = [w for w in wp_workers.get(current_wp, [])
|
|
||||||
if w['id'] not in used_names]
|
|
||||||
for w in candidates[:1]:
|
for w in candidates[:1]:
|
||||||
if name_col is not None and cells[name_col].value is None:
|
if name_col is not None and cells[name_col].value is None:
|
||||||
cells[name_col].value = w['name']
|
cells[name_col].value = w['name']
|
||||||
|
|||||||
Reference in New Issue
Block a user