From 114deba06e52f24906866d56bca0ec54277fa3c3 Mon Sep 17 00:00:00 2001 From: kevgliss Date: Sat, 12 Nov 2016 09:29:42 -0800 Subject: [PATCH] Adding the ability to silence notifications on creation. (#490) --- lemur/certificates/models.py | 1 + lemur/certificates/schemas.py | 2 ++ lemur/certificates/views.py | 1 + 3 files changed, 4 insertions(+) diff --git a/lemur/certificates/models.py b/lemur/certificates/models.py index b8429643..9b44dda2 100644 --- a/lemur/certificates/models.py +++ b/lemur/certificates/models.py @@ -103,6 +103,7 @@ class Certificate(db.Model): if kwargs.get('chain'): self.chain = kwargs['chain'].strip() + self.notify = kwargs.get('notify', True) self.destinations = kwargs.get('destinations', []) self.notifications = kwargs.get('notifications', []) self.description = kwargs.get('description') diff --git a/lemur/certificates/schemas.py b/lemur/certificates/schemas.py index 7d0c4564..b87b1193 100644 --- a/lemur/certificates/schemas.py +++ b/lemur/certificates/schemas.py @@ -59,6 +59,8 @@ class CertificateInputSchema(CertificateCreationSchema): csr = fields.String(validate=validators.csr) + notify = fields.Boolean(default=True) + # certificate body fields organizational_unit = fields.String(missing=lambda: current_app.config.get('LEMUR_DEFAULT_ORGANIZATIONAL_UNIT')) organization = fields.String(missing=lambda: current_app.config.get('LEMUR_DEFAULT_ORGANIZATION')) diff --git a/lemur/certificates/views.py b/lemur/certificates/views.py index f07ab16c..eee3e132 100644 --- a/lemur/certificates/views.py +++ b/lemur/certificates/views.py @@ -167,6 +167,7 @@ class CertificatesList(AuthenticatedResource): "replacements": [{ "id": 1 }, + "notify": true, "validityEnd": "2026-01-01T08:00:00.000Z", "authority": { "name": "verisign"