add second time integrity check

This commit is contained in:
Justus Kuhlmann 2026-04-14 14:17:41 +02:00
commit 91938c3c5a
Signed by: jkuhl
GPG key ID: 00ED992DD79B85A6

View file

@ -2,4 +2,9 @@ import datetime as dt
def check_time_validity(created_at: dt.datetime, updated_at: dt.datetime) -> bool:
return not (created_at > updated_at)
# we expect created_at <= updated_at <= now
if created_at > updated_at:
return False
if updated_at > dt.datetime.now():
return False
return True