Skip to content

Commit

Permalink
MID-6154 Fix error message to be localized in self registration page
Browse files Browse the repository at this point in the history
(cherry picked from commit cd4deb2)
  • Loading branch information
wadahiro authored and katkav committed Apr 2, 2020
1 parent 87fccac commit f7e1f93
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Expand Up @@ -523,6 +523,9 @@ public static void save(Collection<ObjectDelta<? extends ObjectType>> deltas, Mo

page.getModelService().executeChanges(deltas, options, task, result);
} catch (Exception ex) {
if (ex instanceof CommonException) {
subResult.setUserFriendlyMessage(((CommonException) ex).getUserFriendlyMessage());
}
subResult.recordFatalError(ex.getMessage());
LoggingUtils.logUnexpectedException(LOGGER, "Couldn't save object", ex);
} finally {
Expand Down
Expand Up @@ -355,8 +355,14 @@ public OperationResult run() {
LOGGER.trace("Registration for user {} was successfull.", getUserModel().getObject());

} else {
String message;
if (result.getUserFriendlyMessage() != null) {
message = WebModelServiceUtils.translateMessage(result, this);
} else {
message = result.getMessage();
}
getSession().error(
createStringResource("PageSelfRegistration.registration.error", result.getMessage())
createStringResource("PageSelfRegistration.registration.error", message)
.getString());
// removePassword(target);
updateCaptcha(target);
Expand Down

0 comments on commit f7e1f93

Please sign in to comment.