Skip to content

Commit

Permalink
Update 0044_copy_plugins.py
Browse files Browse the repository at this point in the history
  • Loading branch information
fsbraun authored Apr 27, 2024
1 parent cdbcf77 commit 1ecb369
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions djangocms_blog/migrations/0044_copy_plugins.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
from django.contrib.auth import get_user_model
from django.db import migrations

from djangocms_blog.models import Post, PostContent

User = get_user_model()


Expand All @@ -16,6 +14,9 @@ def move_plugins_to_blog_content(apps, schema_editor):
else:
migration_user = None

Post = apps.get_model("djangocms_blog", "Post")
PostContent = apps.get_model("djangocms_blog", "PostContent")

for post in Post.objects.all():
if not post.postcontent_set.exists():
# Not yet migrated
Expand Down

0 comments on commit 1ecb369

Please sign in to comment.