Merge remote-tracking branch 'origin/master' into materialize-cwsvJudo-homepage
This commit is contained in:
@@ -54,19 +54,17 @@ try:
|
|||||||
if t["gebDatum"] not in [None, "0000-00-00"]
|
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(
|
MatrixIm.post(
|
||||||
message="last birthdays: \n"
|
message="last birthdays: \n"
|
||||||
+ "\n".join(
|
+ "\n".join(
|
||||||
[
|
[
|
||||||
f"- {t['name']['given']} {t['name']['family']}: {get_days_since_birthday(t['date_of_birth'])} ({t['date_of_birth'].strftime('%d.%m.')})"
|
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(
|
for t in last_birthday_kids
|
||||||
[
|
|
||||||
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"]),
|
|
||||||
)
|
|
||||||
]
|
]
|
||||||
),
|
),
|
||||||
home_server_url="https://matrix.org",
|
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(
|
MatrixIm.post(
|
||||||
message="next birthdays: \n"
|
message="next birthdays: \n"
|
||||||
+ "\n".join(
|
+ "\n".join(
|
||||||
[
|
[
|
||||||
f"- {t['name']['given']} {t['name']['family']}: {get_days_until_birthday(t['date_of_birth'])} ({t['date_of_birth'].strftime('%d.%m.')})"
|
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(
|
for t in next_birthday_kids
|
||||||
[
|
|
||||||
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"]),
|
|
||||||
)
|
|
||||||
]
|
]
|
||||||
),
|
),
|
||||||
home_server_url="https://matrix.org",
|
home_server_url="https://matrix.org",
|
||||||
|
|||||||
Reference in New Issue
Block a user