From ab6daa662e9775b2fd4ebb6afbc26cf8190de0fd Mon Sep 17 00:00:00 2001 From: Adrian Moennich Date: Thu, 12 Mar 2015 13:56:49 +0100 Subject: [PATCH] Livesync: Ignore updates for deleted items --- livesync/indico_livesync/handler.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/livesync/indico_livesync/handler.py b/livesync/indico_livesync/handler.py index a35f094..f837c10 100644 --- a/livesync/indico_livesync/handler.py +++ b/livesync/indico_livesync/handler.py @@ -153,11 +153,14 @@ def _register_deletion(obj, parent): def _register_change(obj, action): - if isinstance(obj, Conference) and (ConferenceHolder().getById(obj.id, True) is None or obj.getOwner() is None): - # When deleting an event we get data change signals afterwards. We can simple ignore them. - # When moving an event it's even worse, we get a data change notification in the middle of the move while the - # event has no category... - return + if not isinstance(obj, Category): + event = obj.getConference() + if event is None or ConferenceHolder().getById(event.id, True) is None or event.getOwner() is None: + # When deleting an event we get data change signals afterwards. We can simple ignore them. + # When moving an event it's even worse, we get a data change notification in the middle of the move while + # the event has no category... + # Also, ACL changes during user merges might involve deleted objects which we also don't care about + return _init_livesync_g() g.livesync_changes[obj_ref(obj)].add(action)