Hi,
I'm allowing users of project/icla to pretend to be another user for the
purpose of testing.
I have this code that doesn't quite work:
def getUser(userName)
user = ASF::Person.find(userName)
mockName = params['mock']
if mockName != '' and ASF::Person.find(mockName).id == mockName
# if mock is set, set member to mock value
return mockName
else
return userName
end
end
What I'm trying to do is to see if the mocked user actually exists.
The code returns the mock name even if the mock name does not exist.
What is the correct test for user exists?
Thanks,
Craig
Craig L Russell
Secretary, Apache Software Foundation
[email protected] http://db.apache.org/jdo