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 1369a89 commit 2cc3599
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion repromon_app/security.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,8 @@ 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).replace(tzinfo=None) + timedelta(seconds=expire_sec)
datetime.now(timezone.utc) + timedelta(seconds=expire_sec)
expire = expire.timestamp()
data = {
"sub": username,
"exp": expire
Expand Down

0 comments on commit 2cc3599

Please sign in to comment.