Skip to content

Commit

Permalink
Fixed crasher with Django 5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
spookylukey committed Apr 30, 2024
1 parent 4d400f0 commit 36d19f8
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion paypal/pro/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def paypaltime2datetime(s):
return naive
else:
# TIMESTAMP_FORMAT is UTC
return timezone.make_aware(naive, timezone.utc)
return timezone.make_aware(naive, timezone.timezone.utc)


class PayPalError(TypeError):
Expand Down
2 changes: 1 addition & 1 deletion paypal/standard/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def to_python(self, value):
# PST/PDT is 'US/Pacific'
dt = pytz.timezone("US/Pacific").localize(dt, is_dst=zone_part == "PDT")
if not settings.USE_TZ:
dt = timezone.make_naive(dt, timezone=timezone.utc)
dt = timezone.make_naive(dt, timezone=timezone.timezone.utc)
return dt


Expand Down
4 changes: 1 addition & 3 deletions paypal/standard/ipn/tests/test_ipn.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import locale
import unittest
from datetime import datetime
from datetime import datetime, timezone
from decimal import Decimal
from urllib.parse import urlencode

from django.conf import settings
from django.test import TestCase
from django.test.utils import override_settings
from django.utils import timezone

from paypal.standard.ipn.models import PayPalIPN
from paypal.standard.ipn.signals import invalid_ipn_received, valid_ipn_received
Expand Down Expand Up @@ -384,7 +383,6 @@ def test_postback(self):

@override_settings(ROOT_URLCONF="paypal.standard.ipn.tests.test_urls")
class IPNSimulatorTests(TestCase):

# Some requests, as sent by the simulator.

# The simulator itself has bugs. For example, it doesn't send the 'charset'
Expand Down

0 comments on commit 36d19f8

Please sign in to comment.