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()
|
||||
common_name = fields.String(required=True, validate=validators.sensitive_domain)
|
||||
|
||||
validity_start = fields.Date()
|
||||
validity_end = fields.Date()
|
||||
validity_start = fields.DateTime()
|
||||
validity_end = fields.DateTime()
|
||||
validity_years = fields.Integer()
|
||||
|
||||
# certificate body fields
|
||||
|
@ -85,6 +85,9 @@ angular.module('lemur')
|
||||
AuthorityService.create = function (authority) {
|
||||
authority.attachSubAltName();
|
||||
authority.attachCustom();
|
||||
if (authority.validityYears === '') { // if a user de-selects validity years we ignore it
|
||||
delete authority.validityYears;
|
||||
}
|
||||
return AuthorityApi.post(authority);
|
||||
};
|
||||
|
||||
|
@ -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);
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user