From 21d0b76cba6c4365fb371526fbd355534df30cec Mon Sep 17 00:00:00 2001 From: Adrian Moennich Date: Fri, 25 Jun 2021 17:55:16 +0200 Subject: [PATCH] LiveSync: Do not create changes for parent objects Those are not necessary, since any time a creation touches a parent object (e.g. new timetable entry extending the event duration) we already trigger an explicit change for that anyway; and in any other case the parent change is not needed. --- livesync/indico_livesync/handler.py | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/livesync/indico_livesync/handler.py b/livesync/indico_livesync/handler.py index 1a82d5c..054a440 100644 --- a/livesync/indico_livesync/handler.py +++ b/livesync/indico_livesync/handler.py @@ -108,16 +108,8 @@ def _moved(obj, old_parent, **kwargs): def _created(obj, **kwargs): - if isinstance(obj, (Event, EventNote, Attachment)): - parent = None - elif isinstance(obj, Contribution): - parent = obj.event - elif isinstance(obj, SubContribution): - parent = obj.contribution - else: + if not isinstance(obj, (Event, EventNote, Attachment, Contribution, SubContribution)): raise TypeError(f'Unexpected object: {type(obj).__name__}') - if parent: - _register_change(parent, ChangeType.data_changed) _register_change(obj, ChangeType.created)