Fix class name

This commit is contained in:
2025-01-23 08:32:40 +09:00
parent 305d569a0a
commit a2b0436d5b

View File

@ -144,7 +144,20 @@ class EntryCSVProcessor:
"""
時間とデパートメントに基づいてカテゴリを取得
"""
category_name = f"{row['department']}_{row['time']}時間"
time = row['time']
if time:
timeclass = '-'.join(chr(ord(c) + 0xFEE0) if '0' <= c <= '9' else c for c in time)
timeclass += '時間'
else:
timeclass = ''
sexclass = ''
if row['sex'] in ['', '男子']:
sexclass = '男子'
elif row['sex'] in ['', '女子']:
sexclass = '女子'
category_name = f"{row['department']}{sexclass}{timeclass}"
try:
category = NewCategory.objects.get(category_name=category_name)
row['zekken_number'] = category.category_number