diff --git a/cla-backend/cla/models/dynamo_models.py b/cla-backend/cla/models/dynamo_models.py index d8bf79702..dd3f1d9e7 100644 --- a/cla-backend/cla/models/dynamo_models.py +++ b/cla-backend/cla/models/dynamo_models.py @@ -1898,15 +1898,18 @@ 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 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() - ): + if signature.get_signature_approved() and signature.get_signature_signed(): 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(