Update rest_framework/utils/timezone.py

This commit is contained in:
Tom Christie 2025-03-21 12:31:47 +00:00 committed by GitHub
parent 4a70c9da1c
commit 7f27675d62
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

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