text: from django.contrib.auth.models import BaseUserManager
  
  from caresomalia.users.roles import UserRoles
  
  
  class UserManager(BaseUserManager):
      def create_user(self, email: str, password: str, **kwargs):
          """Create new user.
  
          Args:
              email (str)
              password (str)
  
          Raises:
              ValueError: If email or password are None.
  
          Returns:
              User: User that was created.
          """
          if not (email and password):
              raise ValueError("email and password are required")
  
          kwargs.setdefault("is_staff", False)
          kwargs.setdefault("is_superuser", False)
  
          email = self.normalize_email(email)
          user = self.model(email=email, **kwargs)
          user.set_password(password)
          user.full_clean()
          user.save()
          return user
  
      def create_superuser(self, email: str, password: str, **kwargs):
          """Create super user.
  
          Args:
              email (str)
              password (str)
          """
          for permission in ("is_staff", "is_superuser"):
              kwargs[permission] = True
  
          return self.create_user(email, password, role=UserRoles.ADMIN, **kwargs)
  