Merge pull request #1852 from stianst/master

KEYCLOAK-2119
This commit is contained in:
Stian Thorgersen 2015-11-23 12:48:16 +01:00
commit 5e479ba4df
2 changed files with 7 additions and 7 deletions

View file

@ -69,12 +69,12 @@ public class RepresentationToModel {
private static Logger logger = Logger.getLogger(RepresentationToModel.class); private static Logger logger = Logger.getLogger(RepresentationToModel.class);
public static OTPPolicy toPolicy(RealmRepresentation rep) { public static OTPPolicy toPolicy(RealmRepresentation rep) {
OTPPolicy policy = new OTPPolicy(); OTPPolicy policy = new OTPPolicy();
policy.setType(rep.getOtpPolicyType()); if (rep.getOtpPolicyType() != null) policy.setType(rep.getOtpPolicyType());
policy.setLookAheadWindow(rep.getOtpPolicyLookAheadWindow()); if (rep.getOtpPolicyLookAheadWindow() != null) policy.setLookAheadWindow(rep.getOtpPolicyLookAheadWindow());
policy.setInitialCounter(rep.getOtpPolicyInitialCounter()); if (rep.getOtpPolicyInitialCounter() != null) policy.setInitialCounter(rep.getOtpPolicyInitialCounter());
policy.setAlgorithm(rep.getOtpPolicyAlgorithm()); if (rep.getOtpPolicyAlgorithm() != null) policy.setAlgorithm(rep.getOtpPolicyAlgorithm());
policy.setDigits(rep.getOtpPolicyDigits()); if (rep.getOtpPolicyDigits() != null) policy.setDigits(rep.getOtpPolicyDigits());
policy.setPeriod(rep.getOtpPolicyPeriod()); if (rep.getOtpPolicyPeriod() != null) policy.setPeriod(rep.getOtpPolicyPeriod());
return policy; return policy;
} }

View file

@ -236,7 +236,7 @@ public class RealmAdminResource {
} catch (ModelDuplicateException e) { } catch (ModelDuplicateException e) {
throw e; throw e;
} catch (Exception e) { } catch (Exception e) {
logger.error(e); logger.error(e.getMessage(), e);
return ErrorResponse.error("Failed to update " + rep.getRealm() + " Realm.", Response.Status.INTERNAL_SERVER_ERROR); return ErrorResponse.error("Failed to update " + rep.getRealm() + " Realm.", Response.Status.INTERNAL_SERVER_ERROR);
} }
} }