From 3e8396f5ae57068c9e9147c60ec284220a3b1b92 Mon Sep 17 00:00:00 2001 From: Adrian Moennich Date: Mon, 6 Jun 2016 17:46:50 +0200 Subject: [PATCH] LiveSync: Fix category check for attachment events --- livesync/indico_livesync/handler.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/livesync/indico_livesync/handler.py b/livesync/indico_livesync/handler.py index 2c0f05c..bf13924 100644 --- a/livesync/indico_livesync/handler.py +++ b/livesync/indico_livesync/handler.py @@ -22,6 +22,7 @@ from flask import g from sqlalchemy import inspect from indico.core import signals +from indico.core.db.sqlalchemy.links import LinkType from indico.core.db.sqlalchemy.protection import ProtectionMode from indico.modules.events import Event from indico.modules.events.contributions.models.contributions import Contribution @@ -164,7 +165,7 @@ def _note_changed(note, **kwargs): def _attachment_changed(attachment_or_folder, **kwargs): folder = getattr(attachment_or_folder, 'folder', attachment_or_folder) - if not isinstance(folder.object, Category) and not isinstance(folder.object, Session): + if folder.link_type not in (LinkType.category, LinkType.session): _register_change(folder.object, ChangeType.data_changed)