Skip to content

Commit

Permalink
Modifying the old_annotations while iterating through them, caused th…
Browse files Browse the repository at this point in the history
…eir size to be reduced and the loop to end early, leaving annotations in the object
  • Loading branch information
cguardia committed Oct 31, 2014
1 parent 1f4a7e9 commit bf386fe
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/collective/cover/events.py
Expand Up @@ -23,7 +23,8 @@ def override_object_annotations(cover, event):
old_annotations = IAnnotations(event.baseline)
new_annotations = IAnnotations(event.object)

for key in old_annotations:
old_keys = list(old_annotations.keys())
for key in old_keys:
# First remove all annotations in relation to tiles
if key.startswith('plone.tiles.'):
del old_annotations[key]
Expand Down

0 comments on commit bf386fe

Please sign in to comment.