Skip to content

Commit

Permalink
Delete property if colliding with subobject
Browse files Browse the repository at this point in the history
  • Loading branch information
Viktor Dick committed Feb 26, 2024
1 parent 04a1f9f commit 6c7b3b1
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions perfact/zodbsync/zodbsync.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import shutil
import time # for periodic output
import sys
import logging

# for using an explicit transaction manager
import transaction
Expand Down Expand Up @@ -123,6 +124,15 @@ def mod_write(data, parent=None, obj_id=None, override=False, root=None,
else:
obj = root

if obj is not None and not hasattr(obj, 'meta_type'):
logging.getLogger('ZODBSync').warning(
'Removing property with colliding ID! ({} in {})'.format(
obj_id, parent
)
)
parent.manage_delProperties(ids=[obj_id])
obj = None

temp_obj = None
# ID exists? Check for type
if obj and obj.meta_type != meta_type:
Expand Down

0 comments on commit 6c7b3b1

Please sign in to comment.