diff --git a/lemur/certificates/models.py b/lemur/certificates/models.py index 345d6836..bf61ffbd 100644 --- a/lemur/certificates/models.py +++ b/lemur/certificates/models.py @@ -184,28 +184,28 @@ def update_destinations(target, value, initiator): @event.listens_for(Certificate.replaces, 'append') def update_replacement(target, value, initiator): """ - When a certificate is marked as 'replaced' it is then marked as in-active + When a certificate is marked as 'replaced' we should not notify. :param target: :param value: :param initiator: :return: """ - value.active = False + value.notify = False -@event.listens_for(Certificate, 'before_update') -def protect_active(mapper, connection, target): - """ - When a certificate has a replacement do not allow it to be marked as 'active' - - :param connection: - :param mapper: - :param target: - :return: - """ - if target.active: - if not target.notify: - raise Exception( - "Cannot silence notification for a certificate Lemur has been found to be currently deployed onto endpoints" - ) +# @event.listens_for(Certificate, 'before_update') +# def protect_active(mapper, connection, target): +# """ +# When a certificate has a replacement do not allow it to be marked as 'active' +# +# :param connection: +# :param mapper: +# :param target: +# :return: +# """ +# if target.active: +# if not target.notify: +# raise Exception( +# "Cannot silence notification for a certificate Lemur has been found to be currently deployed onto endpoints" +# )