<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def hasUser(self):
 """Check if contact has user """

        username = self.getUsername()
        if not username:
            return False
        user = api.get_user(username)
        return user is not None