mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
Refs #32365 -- Removed support for pytz timezones per deprecation timeline.
This commit is contained in:
@@ -215,9 +215,7 @@ def from_current_timezone(value):
|
||||
if settings.USE_TZ and value is not None and timezone.is_naive(value):
|
||||
current_timezone = timezone.get_current_timezone()
|
||||
try:
|
||||
if not timezone._is_pytz_zone(
|
||||
current_timezone
|
||||
) and timezone._datetime_ambiguous_or_imaginary(value, current_timezone):
|
||||
if timezone._datetime_ambiguous_or_imaginary(value, current_timezone):
|
||||
raise ValueError("Ambiguous or non-existent time.")
|
||||
return timezone.make_aware(value, current_timezone)
|
||||
except Exception as exc:
|
||||
|
||||
Reference in New Issue
Block a user