Skip to content
Snippets Groups Projects
Commit 1c53e20e authored by Jeff Burke's avatar Jeff Burke
Browse files

Merge branch 'ac2' of gimli2:/srv/cadc/git/wopencadc into ac2

parents 8489a462 27289f15
No related branches found
No related tags found
No related merge requests found
...@@ -136,28 +136,29 @@ public class GetUserAction extends AbstractUserAction ...@@ -136,28 +136,29 @@ public class GetUserAction extends AbstractUserAction
try try
{ {
user = userPersistence.getUser(principal); user = userPersistence.getUser(principal);
// Only return user profile info, first and last name.
if (detail != null && detail.equalsIgnoreCase("display"))
{
user.getIdentities().clear();
Set<PersonalDetails> details = user.getDetails(PersonalDetails.class);
if (details.isEmpty())
{
String error = principal.getName() + " missing required PersonalDetails";
throw new IllegalStateException(error);
}
PersonalDetails pd = details.iterator().next();
user.details.clear();
user.details.add(new PersonalDetails(pd.getFirstName(), pd.getLastName()));
}
} }
catch (UserNotFoundException e) catch (UserNotFoundException e)
{ {
user = userPersistence.getPendingUser(principal); user = userPersistence.getPendingUser(principal);
} }
// Only return user profile info, first and last name.
if (detail != null && detail.equalsIgnoreCase("display"))
{
user.getIdentities().clear();
Set<PersonalDetails> details = user.getDetails(PersonalDetails.class);
if (details.isEmpty())
{
String error = principal.getName() + " missing required PersonalDetails";
throw new IllegalStateException(error);
}
PersonalDetails pd = details.iterator().next();
user.details.clear();
user.details.add(new PersonalDetails(pd.getFirstName(), pd.getLastName()));
}
} }
return user; return user;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment