~petersanchez/public-inbox

django-impersonate: Removed usages of django.utils.timezone.utc for Django 5.0 support v1 APPLIED

Sarah Boyce: 1
 Removed usages of django.utils.timezone.utc for Django 5.0 support

 2 files changed, 2 insertions(+), 4 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.code.netlandish.com/~petersanchez/public-inbox/patches/76/mbox | git am -3
Learn more about email & git

[PATCH django-impersonate] Removed usages of django.utils.timezone.utc for Django 5.0 support Export this patch

# HG changeset patch
# User sarahboyce@localhost.localdomain
# Date 1695390294 -7200
#      Fri Sep 22 15:44:54 2023 +0200
# Node ID c0672089c42607eda5f423483cdc79092c9d1efa
# Parent  76e93d43501e5304d6b27e7f7072e4d8aab15104
Removed usages of django.utils.timezone.utc for Django 5.0 support.

diff --git a/impersonate/middleware.py b/impersonate/middleware.py
--- a/impersonate/middleware.py
+++ b/impersonate/middleware.py
@@ -1,9 +1,8 @@
# -*- coding: utf-8 -*-
from datetime import datetime, timedelta
from datetime import datetime, timedelta, timezone

from django.http import HttpResponseNotAllowed
from django.shortcuts import redirect, reverse
from django.utils import timezone
from django.utils.deprecation import MiddlewareMixin
from django.utils.functional import SimpleLazyObject

diff --git a/impersonate/views.py b/impersonate/views.py
--- a/impersonate/views.py
+++ b/impersonate/views.py
@@ -1,11 +1,10 @@
# -*- coding: utf-8 -*-
import logging
from datetime import datetime
from datetime import datetime, timezone

from django.db.models import Q
from django.http import Http404
from django.shortcuts import get_object_or_404, redirect, render
from django.utils import timezone

from .decorators import allowed_user_required
from .helpers import (
Thank you Sarah. This has been applied. For reference, there was another
patch for this same issue here:

https://lists.code.netlandish.com/~petersanchez/public-inbox/patches/71

I think it has some issues so I asked for a revision. Maybe Tom can
piggy back off your work to update his patch for some of the other
housekeeping he did. Or if you've got the inkling, feel free to send
another patch. It's much appreciated!