From 6047d411763f291589101422e89acd44f35c0f47 Mon Sep 17 00:00:00 2001 From: Tobias Kunze Date: Wed, 27 Nov 2024 12:19:38 +0100 Subject: [PATCH] Fix relation-out-of-date check --- pretalx_salesforce/models.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pretalx_salesforce/models.py b/pretalx_salesforce/models.py index 2c50316..206c687 100644 --- a/pretalx_salesforce/models.py +++ b/pretalx_salesforce/models.py @@ -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 (