From 7c8bf5d010c5499511772c56ca45a876449cd867 Mon Sep 17 00:00:00 2001 From: Harold Wanyama Date: Mon, 25 Mar 2024 17:29:20 +0300 Subject: [PATCH] [#4273] Request Ecla - Gerrit - Resolved signature update for the gerrit employee signature update Signed-off-by: Harold Wanyama --- cla-backend/cla/models/docusign_models.py | 7 ++++++- cla-backend/cla/models/dynamo_models.py | 4 +++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/cla-backend/cla/models/docusign_models.py b/cla-backend/cla/models/docusign_models.py index df9c62614..6591827ad 100644 --- a/cla-backend/cla/models/docusign_models.py +++ b/cla-backend/cla/models/docusign_models.py @@ -869,7 +869,12 @@ def request_employee_signature_gerrit(self, project_id, company_id, user_id, ret new_signature.set_signature_acl(user.get_lf_username()) # Save signature before adding user to the LDAP Group. - new_signature.save() + cla.log.debug(f'{fn} - saving signature...{new_signature.to_dict()}') + try: + self._save_employee_signature(new_signature) + except Exception as ex: + cla.log.error(f'{fn} - unable to save signature error: {ex}') + return cla.log.info(f'{fn} - saved signature for: {request_info}') event_data = (f'The user {user.get_user_name()} acknowledged the CLA company affiliation for ' f'company {company.get_company_name()} with ID {company.get_company_id()}, ' diff --git a/cla-backend/cla/models/dynamo_models.py b/cla-backend/cla/models/dynamo_models.py index 14dea8f8f..ec92d62f5 100644 --- a/cla-backend/cla/models/dynamo_models.py +++ b/cla-backend/cla/models/dynamo_models.py @@ -11,6 +11,7 @@ import re import time import uuid +from datetime import timezone from typing import Optional, List import dateutil.parser @@ -2674,7 +2675,8 @@ def to_dict(self): return d def save(self) -> None: - self.model.date_modified = datetime.datetime.utcnow() + self.model.date_modified = datetime.datetime.now(timezone.utc) + cla.log.info(f'saving datetime: {self.model.date_modified}') self.model.save() def load(self, signature_id):