Skip to content

Commit

Permalink
Disregard docs, use primary keys raw
Browse files Browse the repository at this point in the history
  • Loading branch information
rixx committed Nov 15, 2024
1 parent 7bfbc0e commit 4f39672
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions pretalx_salesforce/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,10 @@ def serialize_relations(self):
try:
return [
{
"Session__c": {"pretalx_LegacyID__c": self.submission.code},
"Contact__c": {"pretalx_LegacyID__c": speaker.code},
"Session__c": self.salesforce_id,
"Contact__c": speaker.event_profile(
self.submission.event
).salesforce_profile_sync.salesforce_id,
"Name": f"{speaker.name}{self.submission.title}",
"pretalx_LegacyID__c": f"{speaker.code}-{self.submission.code}",
}
Expand Down Expand Up @@ -226,6 +228,6 @@ def sync_relations(self, sf=None, force=False):
result = sf.Contact_Session__c.create(relation)
speaker_id = relation["Contact__c"]["pretalx_LegacyID__c"]
self.synced_data["relation_mapping"][speaker_id] = result["id"]
self.synced_data["relations"].append(relation)

self.synced_data["relations"] = data
self.save()

0 comments on commit 4f39672

Please sign in to comment.