Hotfix for timestamp comparison bug
This commit is contained in:
parent
09a2eb412b
commit
a50f5c076f
1 changed files with 2 additions and 2 deletions
|
|
@ -20,7 +20,7 @@ from taskflower.sanitize.code import SignUpCodeForUser, ZoneInviteCodeForUser
|
||||||
from taskflower.types import assert_usr
|
from taskflower.types import assert_usr
|
||||||
from taskflower.types.either import Either, Left, Right, gather_successes
|
from taskflower.types.either import Either, Left, Right, gather_successes
|
||||||
from taskflower.types.option import Option
|
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.errors import ResponseErrorBadRequest, ResponseErrorForbidden, ResponseErrorNotFound, response_from_exception
|
||||||
from taskflower.web.utils.request import get_next
|
from taskflower.web.utils.request import get_next
|
||||||
|
|
||||||
|
|
@ -241,7 +241,7 @@ def enter():
|
||||||
)
|
)
|
||||||
).flat_map(
|
).flat_map(
|
||||||
lambda code: Either.do_assert(
|
lambda code: Either.do_assert(
|
||||||
code.expires > now(),
|
ensure_timezone_aware(code.expires) > now(),
|
||||||
'Code expiration date is in the future'
|
'Code expiration date is in the future'
|
||||||
).map(
|
).map(
|
||||||
lambda _: code
|
lambda _: code
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue