From c02a92ad1a3509b1b4b853fa96cc723f2e280db9 Mon Sep 17 00:00:00 2001 From: "Benedikt S. Vogler" Date: Tue, 23 Aug 2022 11:08:14 +0200 Subject: [PATCH 1/4] use non-deprecated etc timezone RemovedInDjango50Warning --- rest_framework_simplejwt/utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rest_framework_simplejwt/utils.py b/rest_framework_simplejwt/utils.py index 48e950ad6..e85f9ed17 100644 --- a/rest_framework_simplejwt/utils.py +++ b/rest_framework_simplejwt/utils.py @@ -3,7 +3,8 @@ from django.conf import settings from django.utils.functional import lazy -from django.utils.timezone import is_naive, make_aware, utc +from django.utils.timezone import is_naive, make_aware +from datetime.timezone import utc def make_utc(dt): From 7fc8150f88e28fc10e72998230c3ee9069478367 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 23 Aug 2022 09:08:39 +0000 Subject: [PATCH 2/4] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- rest_framework_simplejwt/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rest_framework_simplejwt/utils.py b/rest_framework_simplejwt/utils.py index e85f9ed17..477ca3132 100644 --- a/rest_framework_simplejwt/utils.py +++ b/rest_framework_simplejwt/utils.py @@ -1,10 +1,10 @@ from calendar import timegm from datetime import datetime +from datetime.timezone import utc from django.conf import settings from django.utils.functional import lazy from django.utils.timezone import is_naive, make_aware -from datetime.timezone import utc def make_utc(dt): From ff3d7044e4f74b2c3c3c55bcd90b2340aac1045d Mon Sep 17 00:00:00 2001 From: "Benedikt S. Vogler" Date: Tue, 23 Aug 2022 11:13:59 +0200 Subject: [PATCH 3/4] fix imports --- rest_framework_simplejwt/utils.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/rest_framework_simplejwt/utils.py b/rest_framework_simplejwt/utils.py index 477ca3132..252f8acc3 100644 --- a/rest_framework_simplejwt/utils.py +++ b/rest_framework_simplejwt/utils.py @@ -1,7 +1,5 @@ from calendar import timegm -from datetime import datetime -from datetime.timezone import utc - +from datetime import timezone, datetime from django.conf import settings from django.utils.functional import lazy from django.utils.timezone import is_naive, make_aware @@ -9,7 +7,7 @@ def make_utc(dt): if settings.USE_TZ and is_naive(dt): - return make_aware(dt, timezone=utc) + return make_aware(dt, timezone=timezone.utc) return dt From 67c7b46c31e4fd74cfa6fa93dfd6c1ebc0ea3962 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 23 Aug 2022 09:16:41 +0000 Subject: [PATCH 4/4] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- rest_framework_simplejwt/utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rest_framework_simplejwt/utils.py b/rest_framework_simplejwt/utils.py index 252f8acc3..f1c4d3ae3 100644 --- a/rest_framework_simplejwt/utils.py +++ b/rest_framework_simplejwt/utils.py @@ -1,5 +1,6 @@ from calendar import timegm -from datetime import timezone, datetime +from datetime import datetime, timezone + from django.conf import settings from django.utils.functional import lazy from django.utils.timezone import is_naive, make_aware