summaryrefslogtreecommitdiff
path: root/django/forms
diff options
context:
space:
mode:
authorMariusz Felisiak <felisiak.mariusz@gmail.com>2023-01-09 09:03:38 +0100
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2023-01-17 11:49:15 +0100
commite6f82438d4e3750e8d299bfd79dac98eebe9f1e0 (patch)
tree4ee0cbf2c0be9822416aa3d65105f35a9784fd94 /django/forms
parent8d98f99a4ab5de6f2c730399f53eba8bf6bea470 (diff)
Refs #32365 -- Removed support for pytz timezones per deprecation timeline.
Diffstat (limited to 'django/forms')
-rw-r--r--django/forms/utils.py4
1 files changed, 1 insertions, 3 deletions
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: