Fixing issue were, after a user changes their mind validity years wil… (#349)
This commit is contained in:
parent
d95b1a0a41
commit
77f13c9edb
@ -23,8 +23,8 @@ class AuthorityInputSchema(LemurInputSchema):
|
|||||||
description = fields.String()
|
description = fields.String()
|
||||||
common_name = fields.String(required=True, validate=validators.sensitive_domain)
|
common_name = fields.String(required=True, validate=validators.sensitive_domain)
|
||||||
|
|
||||||
validity_start = fields.Date()
|
validity_start = fields.DateTime()
|
||||||
validity_end = fields.Date()
|
validity_end = fields.DateTime()
|
||||||
validity_years = fields.Integer()
|
validity_years = fields.Integer()
|
||||||
|
|
||||||
# certificate body fields
|
# certificate body fields
|
||||||
|
@ -85,6 +85,9 @@ angular.module('lemur')
|
|||||||
AuthorityService.create = function (authority) {
|
AuthorityService.create = function (authority) {
|
||||||
authority.attachSubAltName();
|
authority.attachSubAltName();
|
||||||
authority.attachCustom();
|
authority.attachCustom();
|
||||||
|
if (authority.validityYears === '') { // if a user de-selects validity years we ignore it
|
||||||
|
delete authority.validityYears;
|
||||||
|
}
|
||||||
return AuthorityApi.post(authority);
|
return AuthorityApi.post(authority);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -125,13 +125,8 @@ angular.module('lemur')
|
|||||||
CertificateService.create = function (certificate) {
|
CertificateService.create = function (certificate) {
|
||||||
certificate.attachSubAltName();
|
certificate.attachSubAltName();
|
||||||
certificate.attachCustom();
|
certificate.attachCustom();
|
||||||
// Help users who may have just typed in their authority
|
if (certificate.validityYears === '') { // if a user de-selects validity years we ignore it
|
||||||
if (!certificate.authority) {
|
delete certificate.validityYears;
|
||||||
AuthorityService.findActiveAuthorityByName(certificate.selectedAuthority).then(function (authorities) {
|
|
||||||
if (authorities.length > 0) {
|
|
||||||
certificate.authority = authorities[0];
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
return CertificateApi.post(certificate);
|
return CertificateApi.post(certificate);
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user