SEBSERV-378
This commit is contained in:
parent
2c0bcc25aa
commit
80af47e14e
1 changed files with 18 additions and 1 deletions
|
@ -331,9 +331,26 @@ public class AnsLmsAPITemplate extends AbstractCachedCourseAccess implements Lms
|
||||||
attrs);
|
attrs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private ExamineeAccountDetails tryGetExamineeById(final RestTemplate restTemplate, final String id) {
|
||||||
|
try {
|
||||||
|
ExamineeAccountDetails examineeAccountDetails = getExamineeById(restTemplate, id);
|
||||||
|
|
||||||
|
// SEBSERV-378: If there is no first and last name set, try once again to get the user data
|
||||||
|
if (StringUtils.isBlank(examineeAccountDetails.getDisplayName())) {
|
||||||
|
log.warn("Failed to get ExamineeAccountDetails from Ans. No DisplayName, try once again");
|
||||||
|
examineeAccountDetails = getExamineeById(restTemplate, id);
|
||||||
|
}
|
||||||
|
|
||||||
|
return examineeAccountDetails;
|
||||||
|
} catch (final Exception e) {
|
||||||
|
log.error("Failed to get ExamineeAccountDetails from Ans, try once again: ", e);
|
||||||
|
return getExamineeById(restTemplate, id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Result<ExamineeAccountDetails> getExamineeAccountDetails(final String examineeUserId) {
|
public Result<ExamineeAccountDetails> getExamineeAccountDetails(final String examineeUserId) {
|
||||||
return getRestTemplate().map(t -> this.getExamineeById(t, examineeUserId));
|
return getRestTemplate().map(t -> this.tryGetExamineeById(t, examineeUserId));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in a new issue