mirror of
				https://github.com/django/django.git
				synced 2025-10-31 09:41:08 +00:00 
			
		
		
		
	Refs #23668 -- Removed passing default argument of current TZ to make_aware()/naive.
This commit is contained in:
		| @@ -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 | ||||
|   | ||||
| @@ -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): | ||||
|   | ||||
| @@ -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 = [ | ||||
|   | ||||
		Reference in New Issue
	
	Block a user