forked from sass/tipibot
Fix birthday bug
This commit is contained in:
@@ -34,6 +34,7 @@ class SyncResult:
|
||||
roles_added: list[str] = field(default_factory=list)
|
||||
roles_removed: list[str] = field(default_factory=list)
|
||||
birthday_soon: bool = False
|
||||
birthday_today: bool = False
|
||||
not_found: bool = False
|
||||
errors: list[str] = field(default_factory=list)
|
||||
synced: bool = False # True when no errors; caller writes this to the sheet
|
||||
@@ -186,8 +187,9 @@ async def sync_member(
|
||||
|
||||
# --- Birthday check ---
|
||||
birthday_str = str(row.get("Sünnipäev", "")).strip()
|
||||
if not _is_placeholder(birthday_str) and _is_birthday_soon(birthday_str):
|
||||
result.birthday_soon = True
|
||||
if not _is_placeholder(birthday_str):
|
||||
result.birthday_today = is_birthday_today(birthday_str)
|
||||
result.birthday_soon = _is_birthday_soon(birthday_str)
|
||||
|
||||
# --- Mark synced (caller is responsible for writing to sheet) ---
|
||||
result.synced = not bool(result.errors)
|
||||
|
||||
Reference in New Issue
Block a user