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,51 +54,48 @@ try:
if t["gebDatum"] not in [None, "0000-00-00"] if t["gebDatum"] not in [None, "0000-00-00"]
] ]
MatrixIm.post( last_birthday_kids = sorted(
message="last birthdays: \n" [t for t in trainees if get_days_since_birthday(t["date_of_birth"]) > -14],
+ "\n".join( key=lambda t: get_days_since_birthday(t["date_of_birth"]),
[ )
f"- {t['name']['given']} {t['name']['family']}: {get_days_since_birthday(t['date_of_birth'])} ({t['date_of_birth'].strftime('%d.%m.')})" if last_birthday_kids:
for t in sorted( MatrixIm.post(
[ message="last birthdays: \n"
t + "\n".join(
for t in trainees [
if get_days_since_birthday(t["date_of_birth"]) > -14 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 last_birthday_kids
key=lambda t: get_days_since_birthday(t["date_of_birth"]), ]
) ),
] home_server_url="https://matrix.org",
), room_id="!vFXxgKsLbRLdWCSTIO:matrix.org",
home_server_url="https://matrix.org", credentials={
room_id="!vFXxgKsLbRLdWCSTIO:matrix.org", "user": "@ukenth-the-grumpy:matrix.org",
credentials={ "password": "DQpSs1yn9Y26c1zo",
"user": "@ukenth-the-grumpy:matrix.org", },
"password": "DQpSs1yn9Y26c1zo", )
},
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"]),
) )
MatrixIm.post( if next_birthday_kids:
message="next birthdays: \n" MatrixIm.post(
+ "\n".join( 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( 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 next_birthday_kids
t ]
for t in trainees ),
if get_days_until_birthday(t["date_of_birth"]) < 14 home_server_url="https://matrix.org",
], room_id="!vFXxgKsLbRLdWCSTIO:matrix.org",
key=lambda t: get_days_until_birthday(t["date_of_birth"]), credentials={
) "user": "@ukenth-the-grumpy:matrix.org",
] "password": "DQpSs1yn9Y26c1zo",
), },
home_server_url="https://matrix.org", )
room_id="!vFXxgKsLbRLdWCSTIO:matrix.org",
credentials={
"user": "@ukenth-the-grumpy:matrix.org",
"password": "DQpSs1yn9Y26c1zo",
},
)
except Exception as e: except Exception as e:
MatrixIm.post( MatrixIm.post(
message=f"bdCheck: Exception {e} ({repr(e)})\nResponse was {response}", message=f"bdCheck: Exception {e} ({repr(e)})\nResponse was {response}",