Skip to content

Commit

Permalink
Fixed wraning: "DeprecationWarning: datetime.datetime.utcnow() is dep…
Browse files Browse the repository at this point in the history
…recated and scheduled for removal in a future version".
  • Loading branch information
vmdocua committed Oct 18, 2023
1 parent f097586 commit 1369a89
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion repromon_app/security.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ def create_access_token(self, username: str, expire_sec: int = -1) -> str:
expire_sec = app_settings().TOKEN_EXPIRE_SEC
if username and len(username) > 0:
expire: datetime.datetime = \
datetime.now(timezone.utc) + timedelta(seconds=expire_sec)
datetime.now(timezone.utc).replace(tzinfo=None) + timedelta(seconds=expire_sec)
data = {
"sub": username,
"exp": expire
Expand Down

0 comments on commit 1369a89

Please sign in to comment.