Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
rodfersou committed Nov 21, 2017
1 parent 40ab3cd commit e67c9d5
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions src/collective/cover/content.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,14 +150,6 @@ def get_referenced_objects(self):
refs |= getObjectsFromLinks(self, links)
return refs

def delete_tile(self, tile_id):
"""Delete tile
To delete tile we just need the ID, the type can be anything.
"""
tile = self.restrictedTraverse('collective.cover.basic/' + str(tile_id))
tile.delete()

def purge_deleted_tiles(self):
"""Check if there are any annotation of deleted tiles and destroy it.
Expand All @@ -170,17 +162,15 @@ def purge_deleted_tiles(self):
layout_tiles = self.list_tiles()
annotations = IAnnotations(self)

tile_ids = []
for key in annotations:
if not key.startswith(ANNOTATION_PREFIXES):
continue
tile_id = key.split('.')[-1]
if tile_id in layout_tiles:
continue
if tile_id in tile_ids:
continue
tile_ids.append(tile_id)
self.delete_tile(tile_id)
# XXX: We can't use tile API because there is no way to know the tile type
# for deleted tiles
del annotations[key]


@indexer(ICover)
Expand Down

0 comments on commit e67c9d5

Please sign in to comment.