From ba7fa32109a2813be9e98d2db2cc1a16331e9ba3 Mon Sep 17 00:00:00 2001 From: Alex Morega Date: Mon, 18 Dec 2023 12:33:35 +0200 Subject: [PATCH] Fix tests --- ietf/utils/migrations/0009_megamenu.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ietf/utils/migrations/0009_megamenu.py b/ietf/utils/migrations/0009_megamenu.py index d4ab76d6..729126af 100644 --- a/ietf/utils/migrations/0009_megamenu.py +++ b/ietf/utils/migrations/0009_megamenu.py @@ -16,6 +16,8 @@ def populate_main_menu(apps, schema_editor): MainMenuItem = apps.get_model("utils.MainMenuItem") def live_children(page): + if not page: + return Page.objects.none() # path of children is path of parent with 4 more characters at the end return Page.objects.filter(path__regex=f"^{page.path}....$").filter(live=True).order_by("path")