Skip to content

Commit

Permalink
Lint
Browse files Browse the repository at this point in the history
  • Loading branch information
frcroth committed Oct 24, 2024
1 parent 56b8597 commit 66ce814
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ def replace_menu_items(apps, schema_editor):
Revisions = apps.get_model("wagtailcore", "Revision")

first_level_menu_item_content_type_id = ContentType.objects.get_for_model(FirstLevelMenuItem).id
second_level_menu_item_content_type_id = ContentType.objects.get_for_model(SecondLevelMenuItem).id
second_level_menu_item_content_type_id = ContentType.objects.get_for_model(
SecondLevelMenuItem
).id

for menu_item in FirstLevelMenuItem.objects.all():
basepage_ptr_id = menu_item.basepage_ptr_id
Expand All @@ -35,11 +37,14 @@ def replace_menu_items(apps, schema_editor):
revision.content_type_id = menu_item_content_type
revision.base_content_type_id = menu_item_content_type
revision.save()
for revision in Revisions.objects.filter(content_type_id=second_level_menu_item_content_type_id):
for revision in Revisions.objects.filter(
content_type_id=second_level_menu_item_content_type_id
):
revision.content_type_id = menu_item_content_type
revision.base_content_type_id = menu_item_content_type
revision.save()


class Migration(migrations.Migration):

dependencies = [
Expand Down

0 comments on commit 66ce814

Please sign in to comment.