Fixing issue were, after a user changes their mind validity years wil… (#349)

This commit is contained in:
kevgliss
2016-06-06 12:11:40 -07:00
parent d95b1a0a41
commit 77f13c9edb
3 changed files with 7 additions and 9 deletions

View File

@ -125,13 +125,8 @@ angular.module('lemur')
CertificateService.create = function (certificate) {
certificate.attachSubAltName();
certificate.attachCustom();
// Help users who may have just typed in their authority
if (!certificate.authority) {
AuthorityService.findActiveAuthorityByName(certificate.selectedAuthority).then(function (authorities) {
if (authorities.length > 0) {
certificate.authority = authorities[0];
}
});
if (certificate.validityYears === '') { // if a user de-selects validity years we ignore it
delete certificate.validityYears;
}
return CertificateApi.post(certificate);
};