Skip to content

Commit

Permalink
Add more debug output
Browse files Browse the repository at this point in the history
  • Loading branch information
fsbraun committed Sep 10, 2024
1 parent b4a72fc commit b6443da
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion djangocms_blog/migrations/0044_copy_plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ def __exit__(self, exc_type, exc_value, traceback):

def move_plugins(source, content, content_type):
if source:
print(f"Creating placeholder {source.slot}")
new_placeholder = source.__class__.objects.create(
slot=source.slot,
default_width=source.default_width,
Expand All @@ -30,6 +31,7 @@ def move_plugins(source, content, content_type):
for position, plugin in enumerate(plugins, start=1):
plugin.position = position
plugin.__class__.objects.bulk_update(plugins, ["position"])
print(f"Moved {position} plugins")

def move_plugins_to_blog_content(apps, schema_editor):
"""Adds instances for the new model.
Expand Down Expand Up @@ -98,7 +100,7 @@ def move_plugins_to_blog_content(apps, schema_editor):
post.liveblog.delete()

print("Migration 44 finished.", Post.objects.all().count(), "posts survived.")


def move_plugins_back_to_blog(apps, schema_editor):
"""Adds instances for the new model.ATTENTION: All fields of the model must have a valid default value!"""
Expand Down

0 comments on commit b6443da

Please sign in to comment.