From b734abb8fec5a77ca90b85f1c09e0b12d46559e3 Mon Sep 17 00:00:00 2001 From: Harold Wanyama Date: Tue, 6 Feb 2024 15:00:43 +0300 Subject: [PATCH] [#4225,#4228] Bug/Incorrect date format for ccla - Resolved wrong date_modified format for ccla signature - Handled none values for ecla signature_reference_name attribute Signed-off-by: Harold Wanyama --- cla-backend-go/v2/sign/service.go | 5 +++-- cla-backend/cla/models/docusign_models.py | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/cla-backend-go/v2/sign/service.go b/cla-backend-go/v2/sign/service.go index 1ee7a8fc2..d0f73a981 100644 --- a/cla-backend-go/v2/sign/service.go +++ b/cla-backend-go/v2/sign/service.go @@ -933,10 +933,11 @@ func (s *service) SignedCorporateCallback(ctx context.Context, payload []byte, c // Update the signature status if changed status := info.EnvelopeStatus.Status if status == DocusignCompleted && !signature.SignatureSigned { + _, currentTime := utils.CurrentTime() updates := map[string]interface{}{ "signature_signed": true, - "date_modified": time.Now().String(), - "signed_on": time.Now().String(), + "date_modified": currentTime, + "signed_on": currentTime, } userSignedDate := info.EnvelopeStatus.RecipientStatuses[0].Signed diff --git a/cla-backend/cla/models/docusign_models.py b/cla-backend/cla/models/docusign_models.py index 2683e52c9..df9c62614 100644 --- a/cla-backend/cla/models/docusign_models.py +++ b/cla-backend/cla/models/docusign_models.py @@ -779,7 +779,6 @@ def _save_employee_signature(self,signature): 'signature_document_major_version': {'N': str(signature.get_signature_document_major_version())}, 'signature_reference_id': {'S': signature.get_signature_reference_id()}, 'signature_reference_type': {'S': signature.get_signature_reference_type()}, - 'signature_reference_name': {'S': signature.get_signature_reference_name()}, 'signature_type': {'S': signature.get_signature_type()}, 'signature_signed': {'BOOL': signature.get_signature_signed()}, 'signature_approved': {'BOOL': signature.get_signature_approved()}, @@ -789,6 +788,9 @@ def _save_employee_signature(self,signature): if signature.get_signature_return_url() is not None: item['signature_return_url'] = {'S': signature.get_signature_return_url()} + + if signature.get_signature_reference_name() is not None: + item['signature_reference_name'] = {'S': signature.get_signature_reference_name()} try: self.dynamo_client.put_item(TableName=signature_table, Item=item)