[Django]-What is the use of "user = self.model(useremail=BmUserManager.normalize_email(useremail))" ? is it used to create a new custom user?

6👍

The model attribute of a model manager is just a reference to the model class the manager has been created for. In this case it refers to whatever user model that will use this manager.

0👍

Here self.model is refering to the model that you are using (kind of Custom User).And the method inside BaseUserManager.normalize_email is used to convert the domain of email in lowercase. For Example if you have email like "Amanmishra1321@GMAil.com", then it will convert the email into "Amanmishra1321@gmail.com"

Leave a comment