typeddjango / django-stubs

PEP-484 stubs for Django
MIT License
1.58k stars 436 forks source link

`django.contrib.auth.models.User.email` allows assignment of an integer #2212

Closed flaeppe closed 2 months ago

flaeppe commented 4 months ago

Bug report

django.contrib.auth.models.User.email allows assignment of an integer. It's not just a problem for the User model but for all instances of EmailField.

What's wrong

from django.contrib.auth.models import User
user = User()
user.email = 1

How is that should be

There should be an "Incompatible types in assignment ..."

System information