From 882236cb150da008ff9fedc91e42e0dd2a6666f6 Mon Sep 17 00:00:00 2001 From: Johannes Raggam Date: Wed, 31 Oct 2012 22:46:10 +0100 Subject: [PATCH] For migrations of comments without a valid old_status, apply the 'published' state. --- CHANGES.txt | 4 ++++ plone/app/discussion/browser/migration.py | 5 +++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index 51ace17..69ffb3c 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -4,6 +4,10 @@ Changelog 2.2.1 (unreleased) ------------------ +- For migrations of comments without a valid old_status, apply the 'published' + state. + [thet] + - Re-apply eleddy's "Revert modification date since this is fixed in p.a.caching now." as her commit was lost later on due to some git magic. [thet] diff --git a/plone/app/discussion/browser/migration.py b/plone/app/discussion/browser/migration.py index 8e478ba..7c55491 100644 --- a/plone/app/discussion/browser/migration.py +++ b/plone/app/discussion/browser/migration.py @@ -121,9 +121,10 @@ class View(BrowserView): 'action': None, 'actor': None, 'comment': 'Migrated workflow state', - 'review_state': old_status.get( + 'review_state': old_status and old_status.get( 'review_state', - new_workflow.initial_state), + new_workflow.initial_state) + or 'published', 'time': DateTime() } workflow.setStatusOf('comment_review_workflow',