-
Notifications
You must be signed in to change notification settings - Fork 0
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
Conversation
target_salesforce_v3/sinks.py
Outdated
@@ -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: |
There was a problem hiding this comment.
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"
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed, thank you!
target_salesforce_v3/sinks.py
Outdated
@@ -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": |
There was a problem hiding this comment.
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 ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed 🙌
No description provided.