mirror of
https://github.com/pacnpal/django-anymail.git
synced 2025-12-20 11:51: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,8 +1,6 @@
|
||||
import json
|
||||
from base64 import b64decode
|
||||
from datetime import datetime
|
||||
|
||||
from django.utils.timezone import utc
|
||||
from datetime import datetime, timezone
|
||||
|
||||
from .base import AnymailBaseWebhookView
|
||||
from ..exceptions import AnymailConfigurationError
|
||||
@@ -128,7 +126,7 @@ class SparkPostTrackingWebhookView(SparkPostBaseWebhookView):
|
||||
|
||||
event_type = self.event_types.get(event['type'], EventType.UNKNOWN)
|
||||
try:
|
||||
timestamp = datetime.fromtimestamp(int(event['timestamp']), tz=utc)
|
||||
timestamp = datetime.fromtimestamp(int(event['timestamp']), tz=timezone.utc)
|
||||
except (KeyError, TypeError, ValueError):
|
||||
timestamp = None
|
||||
|
||||
|
||||
Reference in New Issue
Block a user