Im trying to add the created list page as the first child of the parent Index page. The problem is that when I use django treebeard api django treebeard api it succeeds sometimes but other times it shows me an error:
{'path': ['Page with this Path already exists.']}
How can I solve this?
CODE:
@receiver(post_save, sender=ListPage)
def move_page(sender, instance, **kwargs):
instance.move(instance.get_parent(), pos='first-child')