From 732470a21b1456ff000b2be0bc55d724aa55ef00 Mon Sep 17 00:00:00 2001 From: hvelarde Date: Wed, 13 Apr 2016 14:03:19 -0300 Subject: [PATCH] Handle AssertionError on upgrade step --- CHANGES.rst | 5 ++++- src/collective/cover/upgrades/v13/__init__.py | 6 +++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index 792e1a414..8b84e3e64 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -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) diff --git a/src/collective/cover/upgrades/v13/__init__.py b/src/collective/cover/upgrades/v13/__init__.py index 065b86eed..e105c0375 100644 --- a/src/collective/cover/upgrades/v13/__init__.py +++ b/src/collective/cover/upgrades/v13/__init__.py @@ -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)))