feat: improve attendance parsing logic and fix payment date formatting
All checks were successful
Build and Push / build (push) Successful in 8s
Deploy to K8s / deploy (push) Successful in 12s

This commit is contained in:
Jan Novak
2026-03-02 15:06:28 +01:00
parent 70d6794a3c
commit 99b23199b1
4 changed files with 45 additions and 7 deletions

View File

@@ -58,14 +58,31 @@ def calculate_fee(attendance_count: int) -> int:
def get_members(rows: list[list[str]]) -> list[tuple[str, str, list[str]]]:
"""Parse member rows. Returns list of (name, tier, row)."""
"""Parse member rows. Returns list of (name, tier, row).
Stopped at row where first column contains '# last line'.
Skips rows starting with '#'.
"""
members = []
for row in rows[1:]:
name = row[COL_NAME].strip() if len(row) > COL_NAME else ""
if not name or name.lower() in ("jméno", "name", "jmeno"):
if not row or len(row) <= COL_NAME:
continue
first_col = row[COL_NAME].strip()
# Terminator for rows to process
if "# last line" in first_col.lower():
break
# Ignore comments
if first_col.startswith("#"):
continue
if not first_col or first_col.lower() in ("jméno", "name", "jmeno"):
continue
tier = row[COL_TIER].strip().upper() if len(row) > COL_TIER else ""
members.append((name, tier, row))
members.append((first_col, tier, row))
return members