Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed passing default argument of current TZ to make_aware/make_naive. #9596

Merged
merged 1 commit into from
Jan 18, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 1 addition & 2 deletions django/forms/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion django/views/generic/dates.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ def _make_date_lookup_arg(self, value):
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):
Expand Down
2 changes: 1 addition & 1 deletion tests/postgres_tests/test_ranges.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def setUpTestData(cls):
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 = [
Expand Down