diff --git a/djangocms_blog/migrations/0044_copy_plugins.py b/djangocms_blog/migrations/0044_copy_plugins.py index 28a3fbcd..6d1cb383 100644 --- a/djangocms_blog/migrations/0044_copy_plugins.py +++ b/djangocms_blog/migrations/0044_copy_plugins.py @@ -48,24 +48,20 @@ def move_plugins_to_blog_content(apps, schema_editor): translation.delete() # Resolve placeholders - post_media = get_placeholder_from_slot(post.placeholders, "media") - post_content = get_placeholder_from_slot(post.placeholders, "content") - post_liveblog = get_placeholder_from_slot(post.placeholders, "liveblog") - content_media = get_placeholder_from_slot(content.placeholders, "media") content_content = get_placeholder_from_slot(content.placeholders, "content") content_liveblog = get_placeholder_from_slot(content.placeholders, "liveblog") # Move plugins to post content placeholders - if post_media: - media_plugins = post_media.cmsplugin_set.filter(language=translation.language_code) + if post.media: + media_plugins = post.media.cmsplugin_set.filter(language=translation.language_code) media_plugins.update(placeholder=content_media) - if post_content: + if post.content: print("Moving content plugins...") - content_plugins = post_content.cmsplugin_set.filter(language=translation.language_code) + content_plugins = post.content.cmsplugin_set.filter(language=translation.language_code) content_plugins.update(placeholder=content_content) - if post_liveblog: - live_plugins = post_liveblog.cmsplugin_set.filter(language=translation.language_code) + if post.liveblog: + live_plugins = post.liveblog.cmsplugin_set.filter(language=translation.language_code) live_plugins.update(placeholder=content_liveblog)