From e6f82438d4e3750e8d299bfd79dac98eebe9f1e0 Mon Sep 17 00:00:00 2001 From: Mariusz Felisiak Date: Mon, 9 Jan 2023 09:03:38 +0100 Subject: Refs #32365 -- Removed support for pytz timezones per deprecation timeline. --- django/forms/utils.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'django/forms/utils.py') diff --git a/django/forms/utils.py b/django/forms/utils.py index 905babce4d..7577c0bbda 100644 --- a/django/forms/utils.py +++ b/django/forms/utils.py @@ -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: -- cgit v1.3