Refs #23668 -- Removed passing default argument of current TZ to make_aware()/naive.
This commit is contained in:
parent
65728550bd
commit
3c34452ab5
|
@ -174,6 +174,5 @@ def to_current_timezone(value):
|
||||||
to naive datetimes in the current time zone for display.
|
to naive datetimes in the current time zone for display.
|
||||||
"""
|
"""
|
||||||
if settings.USE_TZ and value is not None and timezone.is_aware(value):
|
if settings.USE_TZ and value is not None and timezone.is_aware(value):
|
||||||
current_timezone = timezone.get_current_timezone()
|
return timezone.make_naive(value)
|
||||||
return timezone.make_naive(value, current_timezone)
|
|
||||||
return value
|
return value
|
||||||
|
|
|
@ -267,7 +267,7 @@ class DateMixin:
|
||||||
if self.uses_datetime_field:
|
if self.uses_datetime_field:
|
||||||
value = datetime.datetime.combine(value, datetime.time.min)
|
value = datetime.datetime.combine(value, datetime.time.min)
|
||||||
if settings.USE_TZ:
|
if settings.USE_TZ:
|
||||||
value = timezone.make_aware(value, timezone.get_current_timezone())
|
value = timezone.make_aware(value)
|
||||||
return value
|
return value
|
||||||
|
|
||||||
def _make_single_date_lookup(self, date):
|
def _make_single_date_lookup(self, date):
|
||||||
|
|
|
@ -100,7 +100,7 @@ class TestRangeContainsLookup(PostgreSQLTestCase):
|
||||||
datetime.datetime(year=2016, month=2, day=2),
|
datetime.datetime(year=2016, month=2, day=2),
|
||||||
]
|
]
|
||||||
cls.aware_timestamps = [
|
cls.aware_timestamps = [
|
||||||
timezone.make_aware(timestamp, timezone.get_current_timezone())
|
timezone.make_aware(timestamp)
|
||||||
for timestamp in cls.timestamps
|
for timestamp in cls.timestamps
|
||||||
]
|
]
|
||||||
cls.dates = [
|
cls.dates = [
|
||||||
|
|
Loading…
Reference in New Issue