from django.contrib.auth.models import BaseUserManager


class UserManager(BaseUserManager):

    def create_user(self, email, password='', **kwargs):
        user = self.model(
            email=email,
            password='',
            is_active=True,
            **kwargs
        )
        user.save(using=self._db)

        return user

    def create_superuser(self, email, password, **kwargs):
        user = self.model(
            email=email,
            is_staff=True,
            is_active=True,
            **kwargs
        )
        user.set_password(password)
        user.save(using=self._db)
        return user

from django.contrib.auth.models import BaseUserManager


class UserManager(BaseUserManager):

    def create_user(self, email, person, password='', **kwargs):
        user = self.model(
            email=email,
            person=person,
            password='',
            is_active=True,
            **kwargs
        )
        user.save(using=self._db)

        return user

    def create_superuser(self, email, person, password, **kwargs):
        user = self.model(
            email=email,
            person=person,
            is_staff=True,
            is_active=True,
            **kwargs
        )
        user.set_password(password)
        user.save(using=self._db)
        return user

Update `create_user` method manager to require person
Update `create_user` method manager to require person

  from django.contrib.auth.models import BaseUserManager
  
  
  class UserManager(BaseUserManager):
  
-     def create_user(self, email, password='', **kwargs):
+     def create_user(self, email, person, password='', **kwargs):
          user = self.model(
              email=email,
+             person=person,
              password='',
              is_active=True,
              **kwargs
          )
          user.save(using=self._db)
  
          return user
  
-     def create_superuser(self, email, password, **kwargs):
+     def create_superuser(self, email, person, password, **kwargs):
          user = self.model(
              email=email,
+             person=person,
              is_staff=True,
              is_active=True,
              **kwargs
          )
          user.set_password(password)
          user.save(using=self._db)
          return user
  
Update `create_user` method manager to require person
## Code Before:
from django.contrib.auth.models import BaseUserManager


class UserManager(BaseUserManager):

    def create_user(self, email, password='', **kwargs):
        user = self.model(
            email=email,
            password='',
            is_active=True,
            **kwargs
        )
        user.save(using=self._db)

        return user

    def create_superuser(self, email, password, **kwargs):
        user = self.model(
            email=email,
            is_staff=True,
            is_active=True,
            **kwargs
        )
        user.set_password(password)
        user.save(using=self._db)
        return user

## Instruction:
Update `create_user` method manager to require person
## Code After:
from django.contrib.auth.models import BaseUserManager


class UserManager(BaseUserManager):

    def create_user(self, email, person, password='', **kwargs):
        user = self.model(
            email=email,
            person=person,
            password='',
            is_active=True,
            **kwargs
        )
        user.save(using=self._db)

        return user

    def create_superuser(self, email, person, password, **kwargs):
        user = self.model(
            email=email,
            person=person,
            is_staff=True,
            is_active=True,
            **kwargs
        )
        user.set_password(password)
        user.save(using=self._db)
        return user
