Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add support to send attachments #28

Merged
merged 3 commits into from
Dec 5, 2024
Merged

add support to send attachments #28

merged 3 commits into from
Dec 5, 2024

Conversation

keyn4
Copy link
Contributor

@keyn4 keyn4 commented Dec 3, 2024

No description provided.

@@ -1047,3 +1060,31 @@ def upsert_record(self, record, context):
self.logger.exception(f"Error encountered while creating {object_type}")
raise e


def link_attachment_to_object(self, file_id, linked_object_id):
if self.name == "ContentVersion" and not linked_object_id:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens if this is called when linked_object_id is None and self.name != "ContentVersion"?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed, thank you!

@@ -1047,3 +1060,31 @@ def upsert_record(self, record, context):
self.logger.exception(f"Error encountered while creating {object_type}")
raise e


def link_attachment_to_object(self, file_id, linked_object_id):
if self.name == "ContentVersion":
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's generally cleaner to do:

if self.name != "ContentVersion":
  return

# rest of code here ...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed 🙌

@hsyyid hsyyid merged commit 7cb6ff1 into main Dec 5, 2024
0 of 5 checks passed
@hsyyid hsyyid deleted the hgi-6745 branch December 5, 2024 14:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants