diff --git a/src/wagtail_personalisation/views.py b/src/wagtail_personalisation/views.py index 8f4df4e..ee419e5 100644 --- a/src/wagtail_personalisation/views.py +++ b/src/wagtail_personalisation/views.py @@ -139,7 +139,7 @@ def copy_page_view(request, page_id, segment_id): } try: - variant = Page.objects.get(slug=slug, depth=page.depth) + variant = Page.objects.get(slug=slug, parent=page.parent) except Page.DoesNotExist: variant = page.copy(update_attrs=update_attrs, copy_revisions=False)