Mypy flags unreachable
on pre-save
and checking for instance ID
#2014
Labels
bug
Something isn't working
unreachable
on pre-save
and checking for instance ID
#2014
Bug report
We are implementing pre-save of some models and there usually we check if the instance is being created or not by doing
What's wrong
In this case mypy flagging this with the following error indicated above
How is that should be
On pre-save
instance.id
should be either the Field or None as it can be None in case of creation of the object.Do not know how to properly implement it though...
System information
python
version: 3.11.5django
version: 3.2.23mypy
version: 1.9.0django-stubs
version: 4.2.7django-stubs-ext
version: 4.2.7The text was updated successfully, but these errors were encountered: