def create_user(self, email, password=None, **extra_fields):
    'Create and saves a new user'
    if (not email):
        raise ValueError('Users must have email address')
    user = self.model(email=self.normalize_email(email), **extra_fields)
    user.set_password(password)
    user.save(using=self._db)
    return user
Create and saves a new user
def create_user(self, email, password=None, **extra_fields):
    
    if (not email):
        raise ValueError('Users must have email address')
    user = self.model(email=self.normalize_email(email), **extra_fields)
    user.set_password(password)
    user.save(using=self._db)
    return user