Skip to content

Commit

Permalink
Merge pull request #3826 from nickmango/revert/latest-signature
Browse files Browse the repository at this point in the history
Revert fetching latest signature
  • Loading branch information
nickmango authored Mar 2, 2023
2 parents 4128212 + ed9bf70 commit 3859d4b
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions cla-backend/cla/models/dynamo_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 3859d4b

Please sign in to comment.