mirror of
https://github.com/lucaspalomodevelop/indico-plugins.git
synced 2026-03-13 07:29:39 +00:00
LiveSync: Connect with note signals
This commit is contained in:
parent
177d324fd1
commit
1464354081
@ -69,6 +69,10 @@ def connect_signals(plugin):
|
||||
plugin.connect(signals.category.domain_access_revoked, _domain_changed)
|
||||
plugin.connect(signals.event.domain_access_granted, _domain_changed)
|
||||
plugin.connect(signals.event.domain_access_revoked, _domain_changed)
|
||||
# notes
|
||||
plugin.connect(signals.event.notes.note_added, _note_changed)
|
||||
plugin.connect(signals.event.notes.note_deleted, _note_changed)
|
||||
plugin.connect(signals.event.notes.note_modified, _note_changed)
|
||||
|
||||
|
||||
def _moved(obj, old_parent, new_parent, **kwargs):
|
||||
@ -115,6 +119,13 @@ def _domain_changed(obj, **kwargs):
|
||||
_register_change(obj, ChangeType.protection_changed)
|
||||
|
||||
|
||||
def _note_changed(note, **kwargs):
|
||||
obj = note.linked_object
|
||||
if isinstance(obj, Session):
|
||||
obj = ConferenceHolder().getById(note.event_id)
|
||||
_register_change(obj, ChangeType.data_changed)
|
||||
|
||||
|
||||
def _apply_changes(sender, **kwargs):
|
||||
if not hasattr(g, 'livesync_changes'):
|
||||
return
|
||||
|
||||
@ -21,7 +21,7 @@ from setuptools import setup, find_packages
|
||||
|
||||
setup(
|
||||
name='indico_livesync',
|
||||
version='0.3',
|
||||
version='0.4',
|
||||
url='https://github.com/indico/indico-plugins',
|
||||
license='https://www.gnu.org/licenses/gpl-3.0.txt',
|
||||
author='Indico Team',
|
||||
@ -31,7 +31,7 @@ setup(
|
||||
include_package_data=True,
|
||||
platforms='any',
|
||||
install_requires=[
|
||||
'indico>=1.9.3'
|
||||
'indico>=1.9.4'
|
||||
],
|
||||
classifiers=[
|
||||
'Environment :: Plugins',
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user