Update rest_framework/utils/timezone.py

This commit is contained in:
Tom Christie 2025-03-21 12:33:03 +00:00 committed by GitHub
parent 2f288fc40a
commit 56b4ce26eb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -18,6 +18,6 @@ def datetime_ambiguous(dt):
)
def valid_datetime(dt) -> bool:
def valid_datetime(dt):
"""Returns True if the datetime is not ambiguous or imaginary, False otherwise."""
return isinstance(dt.tzinfo, tzinfo) and not datetime_ambiguous(dt)