Skip to content

Commit

Permalink
Merge pull request #620 from collective/issue_619
Browse files Browse the repository at this point in the history
Handle AssertionError on upgrade step to profile 13
  • Loading branch information
rodfersou committed Apr 13, 2016
2 parents 12a5396 + 732470a commit 6bfb8d3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 4 additions & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ There's a frood who really knows where his towel is.
1.1b2 (unreleased)
^^^^^^^^^^^^^^^^^^

- Nothing changed yet.
- Handle `AssertionError` on upgrade step to profile 13 to avoid failures when a cover object has duplicated tiles on it.
Now, an error message will be logged and the object will be skipped;
you must manually remove the duplicated tiles (closes #619).
[hvelarde]


1.1b1 (2016-03-31)
Expand Down
6 changes: 5 additions & 1 deletion src/collective/cover/upgrades/v13/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ def update_references(setup_tool):
results = catalog.unrestrictedSearchResults(**query)
for brain in results:
obj = brain.getObject()
update_link_integrity(obj, None)
try:
update_link_integrity(obj, None)
except AssertionError:
msg = 'Duplicated tiles in {0} ({1}); skipping'
logger.error(msg.format(obj.absolute_url(), obj.list_tiles()))

logger.info('References updated on {0} objects.'.format(len(results)))

0 comments on commit 6bfb8d3

Please sign in to comment.