You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
from contextlib import suppress
from typing import Type
from django.core.exceptions import ObjectDoesNotExist
from django.db.models import Model
def get_next_pk(model: Type[Model]) -> int:
pk = 1
with suppress(ObjectDoesNotExist):
pk = model.objects.latest('pk').pk + 1
return pk
Bug report
Mypy error in function
mypy.ini
What's wrong
After run
mypy .
I receive next error:System information
python
version: 3.11django
version: 4.2.5mypy
version: 1.5.1django-stubs
version: 4.2.4django-stubs-ext
version: 4.2.2The text was updated successfully, but these errors were encountered: