From 19cce4bdfb7175f41b5bc9c51ecf5b5ebe6d5f5f Mon Sep 17 00:00:00 2001 From: Miguel Grinberg Date: Wed, 4 Jun 2025 12:38:11 +0100 Subject: [PATCH] Add the recent mypy fix to field.py to the template for this file (#2979) (cherry picked from commit e616da96335f59849e193716132de8769acc9813) --- utils/templates/field.py.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/templates/field.py.tpl b/utils/templates/field.py.tpl index 95ee2f391..030060d23 100644 --- a/utils/templates/field.py.tpl +++ b/utils/templates/field.py.tpl @@ -367,7 +367,7 @@ class {{ k.name }}({{ k.parent }}): if isinstance(data, datetime): if self._default_timezone and data.tzinfo is None: data = data.replace(tzinfo=self._default_timezone) - return data + return cast(datetime, data) if isinstance(data, date): return data if isinstance(data, int):