Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
AStA
Digitaler 3G-Nachweis
Commits
8158684d
Commit
8158684d
authored
Mar 29, 2022
by
Leon Tappe
🔥
Browse files
add zoneinfo to date comparison
parent
e025501b
Changes
1
Hide whitespace changes
Inline
Side-by-side
backend/website/routes.py
View file @
8158684d
...
...
@@ -199,7 +199,7 @@ def decrypt_ticket(ticket):
def
check_ticket
(
decrypted
):
# compare current time with request's datetime in utc
if
(
decrypted
>
datetime
(
2022
,
3
,
31
,
23
,
0
,
0
,
0
)
and
datetime
.
now
()
<
datetime
(
2022
,
4
,
3
,
0
,
0
,
0
,
0
)):
if
(
decrypted
>
datetime
(
2022
,
3
,
31
,
23
,
0
,
0
,
0
,
tzinfo
=
tzutc
()
)
and
datetime
.
now
(
tzutc
()
)
<
datetime
(
2022
,
4
,
3
,
0
,
0
,
0
,
0
,
tzinfo
=
tzutc
()
)):
return
True
return
decrypted
>
datetime
.
now
(
tzutc
())
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment