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,7 +1,6 @@
|
||||
import json
|
||||
from datetime import datetime
|
||||
from datetime import datetime, timezone
|
||||
|
||||
from django.utils.timezone import utc
|
||||
|
||||
from .base import AnymailBaseWebhookView
|
||||
from ..inbound import AnymailInboundMessage
|
||||
@@ -68,7 +67,7 @@ class MailjetTrackingWebhookView(AnymailBaseWebhookView):
|
||||
event_type = EventType.DEFERRED
|
||||
|
||||
try:
|
||||
timestamp = datetime.fromtimestamp(esp_event['time'], tz=utc)
|
||||
timestamp = datetime.fromtimestamp(esp_event['time'], tz=timezone.utc)
|
||||
except (KeyError, ValueError):
|
||||
timestamp = None
|
||||
|
||||
|
||||
Reference in New Issue
Block a user