[Answered ]-How can I supress this type error from Django create_user?

1👍

When you define objects in your User model you should give it a type like this:

class User(AbstractBaseUser):
    ...
    
   objects: UserManager = UserManager()

0👍

Try this:

from django.contrib.auth.models import User, AbstractUser
from django.contrib.auth import get_user_model
# import of `UserManager`

user_manager: UserManager = get_user_model().objects

user_manager.create_user(**user_data)

Leave a comment