Skip to content

Commit

Permalink
Fix relation-out-of-date check
Browse files Browse the repository at this point in the history
  • Loading branch information
rixx committed Nov 27, 2024
1 parent cd713cd commit 6047d41
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pretalx_salesforce/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,12 @@ def data_out_of_date(self):

@property
def relations_out_of_date(self):
return self.serialize_relations() != self.synced_data.get("relations", [])
# We compare our generated IDs as a shorthand – the rest of the data is
# static by definition, and otherwise we’d have to deduplicate a list of
# (unhashable) dictionaries
return {d["pretalx_LegacyID__c"] for d in self.serialize_relations()} == {
d["pretalx_LegacyID__c"] for d in self.synced_data["relations"]
}

def should_sync(self):
if (
Expand Down

0 comments on commit 6047d41

Please sign in to comment.