mirror of
https://github.com/lucaspalomodevelop/indico-plugins.git
synced 2026-03-12 23:27:22 +00:00
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.
This commit is contained in:
parent
a9ccd18b3d
commit
21d0b76cba
@ -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)
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user