Skip to content
This repository has been archived by the owner on Dec 13, 2024. It is now read-only.

Commit

Permalink
PATCH: Add the comments to the actual object
Browse files Browse the repository at this point in the history
While here I've also renamed the object, so that it's clearer
  • Loading branch information
jonodrew committed May 8, 2024
1 parent 280b191 commit d73b165
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lambda_/zendesk_backup/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,13 @@ def save_support(ticket_ids: Optional[list] = None):

ticket_as_dict = ticket.to_dict()

dobj = add_athena_datetimes(ticket_as_dict)
backup_object = add_athena_datetimes(ticket_as_dict)

# add all comments to the ticket
ticket_as_dict["comments"] = [comment.to_dict() for comment in comment_thread]
backup_object["comments"] = [comment.to_dict() for comment in comment_thread]

s3_client().put_object(
Body=json.dumps(dobj, default=str).encode("utf-8"),
Body=json.dumps(backup_object, default=str).encode("utf-8"),
Bucket=s3_bucket,
Key=key,
)
Expand Down

0 comments on commit d73b165

Please sign in to comment.