code: def hasUser(self):
          
          username = self.getUsername()
          if not username:
              return False
          user = api.get_user(username)
          return user is not None
docs: Check if contact has user