diff options
| author | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2025-02-18 08:35:36 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-02-18 08:35:36 +0100 |
| commit | efb7f9ced2dcf71294353596a265e3fd67faffeb (patch) | |
| tree | b24b6127022fbe48c517d1acbe9e3c0c502391d9 /django/views | |
| parent | 0d1dd6bba0c18b7feb6caa5cbd8df80fbac54afd (diff) | |
Refs #36005 -- Used datetime.UTC alias instead of datetime.timezone.utc.
datetime.UTC was added in Python 3.11.
Diffstat (limited to 'django/views')
| -rw-r--r-- | django/views/decorators/http.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/django/views/decorators/http.py b/django/views/decorators/http.py index a4c1ebc31e..efdaa21e30 100644 --- a/django/views/decorators/http.py +++ b/django/views/decorators/http.py @@ -110,7 +110,7 @@ def condition(etag_func=None, last_modified_func=None): if last_modified_func: if dt := last_modified_func(request, *args, **kwargs): if not timezone.is_aware(dt): - dt = timezone.make_aware(dt, datetime.timezone.utc) + dt = timezone.make_aware(dt, datetime.UTC) res_last_modified = int(dt.timestamp()) # The value from etag_func() could be quoted or unquoted. res_etag = etag_func(request, *args, **kwargs) if etag_func else None |
