Martí Bosch
Martí Bosch

Reputation: 16

django.core.exceptions.ValidationError: {'path': ['Page with this Path already exists.']}

I am getting a django.core.exceptions.ValidationError: {'path': ['Page with this Path already exists.']} when attempting to create a new page.

I have the following page tree:

$ from wagtail.models import Page

$ [(p.url, p.path) for p in Page.objects.all()]

[(None, '0001'),
 ('/en-us/', '00010001'),
 ('/en-us/events/', '000100010001'),
 ('/en-us/events/webinars/', '0001000100010001'),
 ('/en-us/events/webinars/some-webinar/', '00010001000100010001'),
 ('/en-us/events/newsletter/', '0001000100010002')]

When I try to add a new page (from wagtail's admin) under events, I get a django.core.exceptions.ValidationError: {'path': ['Page with this Path already exists.']}. From the interactive debugger I can see that the attempted new page's path is set to '0001000100010002'.

I have tried running python manage.py fixtree as suggested in related issues with no success, i.e., I get:

Checking page tree for problems...
No problems found.

Checking collection tree for problems...
No problems found.

How can this be solved? I am using django 4.2.9 and wagtail 5.2.3 (with wagtail-localize 1.8, wagtailmenus 3.1.9 and wagtail-metadata 4.0.2).

Upvotes: 0

Views: 83

Answers (1)

cnk
cnk

Reputation: 1296

Try:

python manage.py fixtree --full

Upvotes: 0

Related Questions