Refs #23668 -- Removed passing default argument of current TZ to make_aware()/naive.

This commit is contained in:
Jon Dufresne 2018-01-18 08:21:12 -08:00 committed by Tim Graham
parent 65728550bd
commit 3c34452ab5
3 changed files with 3 additions and 4 deletions

View File

@ -174,6 +174,5 @@ def to_current_timezone(value):
to naive datetimes in the current time zone for display.
"""
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, current_timezone)
return timezone.make_naive(value)
return value

View File

@ -267,7 +267,7 @@ class DateMixin:
if self.uses_datetime_field:
value = datetime.datetime.combine(value, datetime.time.min)
if settings.USE_TZ:
value = timezone.make_aware(value, timezone.get_current_timezone())
value = timezone.make_aware(value)
return value
def _make_single_date_lookup(self, date):

View File

@ -100,7 +100,7 @@ class TestRangeContainsLookup(PostgreSQLTestCase):
datetime.datetime(year=2016, month=2, day=2),
]
cls.aware_timestamps = [
timezone.make_aware(timestamp, timezone.get_current_timezone())
timezone.make_aware(timestamp)
for timestamp in cls.timestamps
]
cls.dates = [