Merge remote-tracking branch 'origin/master' into materialize-cwsvJudo-homepage

This commit is contained in:
marko
2025-07-04 13:12:17 +02:00

View File

@@ -54,19 +54,17 @@ try:
if t["gebDatum"] not in [None, "0000-00-00"]
]
last_birthday_kids = sorted(
[t for t in trainees if get_days_since_birthday(t["date_of_birth"]) > -14],
key=lambda t: get_days_since_birthday(t["date_of_birth"]),
)
if last_birthday_kids:
MatrixIm.post(
message="last birthdays: \n"
+ "\n".join(
[
f"- {t['name']['given']} {t['name']['family']}: {get_days_since_birthday(t['date_of_birth'])} ({t['date_of_birth'].strftime('%d.%m.')})"
for t in sorted(
[
t
for t in trainees
if get_days_since_birthday(t["date_of_birth"]) > -14
],
key=lambda t: get_days_since_birthday(t["date_of_birth"]),
)
for t in last_birthday_kids
]
),
home_server_url="https://matrix.org",
@@ -77,19 +75,18 @@ try:
},
)
next_birthday_kids = sorted(
[t for t in trainees if get_days_until_birthday(t["date_of_birth"]) < 14],
key=lambda t: get_days_until_birthday(t["date_of_birth"]),
)
if next_birthday_kids:
MatrixIm.post(
message="next birthdays: \n"
+ "\n".join(
[
f"- {t['name']['given']} {t['name']['family']}: {get_days_until_birthday(t['date_of_birth'])} ({t['date_of_birth'].strftime('%d.%m.')})"
for t in sorted(
[
t
for t in trainees
if get_days_until_birthday(t["date_of_birth"]) < 14
],
key=lambda t: get_days_until_birthday(t["date_of_birth"]),
)
for t in next_birthday_kids
]
),
home_server_url="https://matrix.org",