mirror of
https://github.com/pacnpal/django-anymail.git
synced 2025-12-20 03:41:05 -05:00
Confirm support for Django 4.1
Replaces deprecated `django.utils.timezone.utc` with `datetime.timezone.utc` (available since Python 3.2).
This commit is contained in:
@@ -1,11 +1,9 @@
|
||||
import binascii
|
||||
import json
|
||||
from base64 import b64decode
|
||||
from datetime import datetime
|
||||
from datetime import datetime, timezone
|
||||
|
||||
|
||||
from django.utils.timezone import utc
|
||||
|
||||
from .base import AnymailBaseWebhookView
|
||||
from ..exceptions import (
|
||||
AnymailInvalidAddress,
|
||||
@@ -94,7 +92,7 @@ class PostalTrackingWebhookView(PostalBaseWebhookView):
|
||||
|
||||
raw_timestamp = esp_event.get("timestamp")
|
||||
timestamp = (
|
||||
datetime.fromtimestamp(int(raw_timestamp), tz=utc)
|
||||
datetime.fromtimestamp(int(raw_timestamp), tz=timezone.utc)
|
||||
if raw_timestamp
|
||||
else None
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user