From 9030aed8a44a27ef057f45e30b8c74c299ff458b Mon Sep 17 00:00:00 2001 From: kevgliss Date: Mon, 5 Dec 2016 11:08:29 -0800 Subject: [PATCH] Ensuring that our syncing process can find duplicate certifcates that do no need to be sync'd (#560) --- lemur/certificates/service.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lemur/certificates/service.py b/lemur/certificates/service.py index 2ff1d3c2..8065d51f 100644 --- a/lemur/certificates/service.py +++ b/lemur/certificates/service.py @@ -86,10 +86,10 @@ def find_duplicates(cert): :param cert: :return: """ - if cert.get('chain'): - return Certificate.query.filter_by(body=cert['body'].strip(), chain=cert['chain'].strip()).all() + if cert.chain: + return Certificate.query.filter_by(body=cert.body.strip(), chain=cert.chain.strip()).all() else: - return Certificate.query.filter_by(body=cert['body'].strip(), chain=None).all() + return Certificate.query.filter_by(body=cert.body.strip(), chain=None).all() def export(cert, export_plugin):