Hotfix for timestamp comparison bug

This commit is contained in:
digimint 2025-11-22 01:42:10 -06:00
parent 09a2eb412b
commit a50f5c076f
Signed by: digimint
GPG key ID: 8DF1C6FD85ABF748

View file

@ -20,7 +20,7 @@ from taskflower.sanitize.code import SignUpCodeForUser, ZoneInviteCodeForUser
from taskflower.types import assert_usr
from taskflower.types.either import Either, Left, Right, gather_successes
from taskflower.types.option import Option
from taskflower.util.time import now
from taskflower.util.time import ensure_timezone_aware, now
from taskflower.web.errors import ResponseErrorBadRequest, ResponseErrorForbidden, ResponseErrorNotFound, response_from_exception
from taskflower.web.utils.request import get_next
@ -241,7 +241,7 @@ def enter():
)
).flat_map(
lambda code: Either.do_assert(
code.expires > now(),
ensure_timezone_aware(code.expires) > now(),
'Code expiration date is in the future'
).map(
lambda _: code