From ed9bf706ff4bf46ec1457c55453c1c1b7b9e8d5b Mon Sep 17 00:00:00 2001 From: Harold Wanyama Date: Thu, 2 Mar 2023 18:29:07 +0300 Subject: [PATCH] Revert fetching latest signature Signed-off-by: Harold Wanyama --- cla-backend/cla/models/dynamo_models.py | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/cla-backend/cla/models/dynamo_models.py b/cla-backend/cla/models/dynamo_models.py index dd3f1d9e7..d8bf79702 100644 --- a/cla-backend/cla/models/dynamo_models.py +++ b/cla-backend/cla/models/dynamo_models.py @@ -1898,18 +1898,15 @@ def get_latest_signature(self, project_id, company_id=None, signature_signed=Non signature_signed=signature_signed, signature_approved=signature_approved) latest = None for signature in signatures: - if signature.get_signature_approved() and signature.get_signature_signed(): + if latest is None: + latest = signature + elif signature.get_signature_document_major_version() > latest.get_signature_document_major_version(): + latest = signature + elif ( + signature.get_signature_document_major_version() == latest.get_signature_document_major_version() + and signature.get_signature_document_minor_version() > latest.get_signature_document_minor_version() + ): latest = signature - break - # if latest is None: - # latest = signature - # elif signature.get_signature_document_major_version() > latest.get_signature_document_major_version(): - # latest = signature - # elif ( - # signature.get_signature_document_major_version() == latest.get_signature_document_major_version() - # and signature.get_signature_document_minor_version() > latest.get_signature_document_minor_version() - # ): - # latest = signature if latest is None: cla.log.debug(