Commit 2a89661
committed
refactor(admin): replace deprecated datetime.utcnow() (#772)
Python 3.12 deprecated `datetime.utcnow()` in favour of the
timezone-aware `datetime.now(datetime.UTC)`.
Drop the `.replace(tzinfo=None)` that stripped the timezone from
`last_activity` to make it match the naive `utcnow()` result.
Both `last_activity` (parsed with `%z`) and the new
`datetime.now(datetime.UTC)` are now timezone-aware UTC values,
so the subtraction yields the same `timedelta` as before.1 parent b06de62 commit 2a89661
1 file changed
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1049 | 1049 | | |
1050 | 1050 | | |
1051 | 1051 | | |
1052 | | - | |
1053 | | - | |
| 1052 | + | |
| 1053 | + | |
1054 | 1054 | | |
1055 | 1055 | | |
1056 | 1056 | | |
| |||
0 commit comments