Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix utcnow deprecation warning #1369

Merged
merged 1 commit into from
Mar 11, 2024

Conversation

MatthewScholefield
Copy link
Contributor

I'm seeing the following warning:

lib/python3.12/site-packages/fastapi_users/jwt.py:25: DeprecationWarning: datetime.datetime.utcnow() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.now(datetime.UTC).
    expire = datetime.utcnow() + timedelta(seconds=lifetime_seconds)

To fix it I changed to the timezone aware version. Since it gets serialized directly below I don't think there should be any impact from this change.

Copy link

codecov bot commented Mar 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (2ffb700) to head (783bfe5).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##            master     #1369   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           35        35           
  Lines          976       976           
=========================================
  Hits           976       976           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@frankie567
Copy link
Member

Good catch, thank you @MatthewScholefield 🙏

@all-contributors add @MatthewScholefield for code

@frankie567 frankie567 merged commit a4287b8 into fastapi-users:master Mar 11, 2024
13 checks passed
Copy link
Contributor

@frankie567

I've put up a pull request to add @MatthewScholefield! 🎉

Ae-Mc pushed a commit to Ae-Mc/fastapi-users that referenced this pull request Mar 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants