Skip to content

Commit

Permalink
fix: filter revision created by wagtail (#2849)
Browse files Browse the repository at this point in the history
  • Loading branch information
asadali145 authored Jan 4, 2024
1 parent 4b277a7 commit 2c8294c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cms/migrations/0066_fix_revision_content.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ def migrate_content_type_id(apps, schema_editor):
)
blog_index_page_ids = list(BlogIndexPage.objects.values_list("id", flat=True))
if blog_index_page_ids:
blog_page_revisions = Revision.objects.filter(object_id__in=blog_index_page_ids)
blog_page_revisions = Revision.objects.filter(
object_id__in=blog_index_page_ids, content_type_id__isnull=True
)
for revision in blog_page_revisions:
blog_page_content = dict(revision.content)
blog_page_content["content_type"] = blog_page_content["content_type_id"]
Expand All @@ -36,7 +38,7 @@ def migrate_content_type_id(apps, schema_editor):
webinar_index_page_ids = list(WebinarIndexPage.objects.values_list("id", flat=True))
if webinar_index_page_ids:
webinar_page_revisions = Revision.objects.filter(
object_id__in=webinar_index_page_ids
object_id__in=webinar_index_page_ids, content_type_id__isnull=True
)
for revision in webinar_page_revisions:
webinar_page_content = dict(revision.content)
Expand Down

0 comments on commit 2c8294c

Please sign in to comment.