'Given a desired username, return a User object.'

def opt_in(self, desired_username):

    from gratipay.security.user import User
    user = User.from_username(self.participant.username)
    assert (not user.ANON), self.participant
    if self.participant.is_claimed:
        newly_claimed = False
    else:
        newly_claimed = True
        user.participant.set_as_claimed()
        try:
            user.participant.change_username(desired_username)
        except ProblemChangingUsername:
            pass
    if user.participant.is_closed:
        user.participant.update_is_closed(False)
    return (user, newly_claimed)
