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:
Adrian Moennich 2021-06-25 17:55:16 +02:00 committed by Adrian
parent a9ccd18b3d
commit 21d0b76cba

View File

@ -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)