def create_superuser(self, email, password, **extra_fields):  # type: ignore[no-untyped-def]
        """Create and save a SuperUser with the given email and password."""
        extra_fields.setdefault("is_staff", True)
        extra_fields.setdefault("is_superuser", True)

        if extra_fields.get("is_staff") is not True:
            raise ValueError("Superuser must have is_staff=True.")
        if extra_fields.get("is_superuser") is not True:
            raise ValueError("Superuser must have is_superuser=True.")

        return self._create_user(email, password, **extra_fields)  # type: ignore[no-untyped-call]
Create and save a SuperUser with the given email and password.
api/users/models.py