-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
Description
A node cannot be renamed to the name it already has. Doing this is silly of course, but there's no need for it to be fatal.
In [1]: from wheelcms_axle.node import Node
In [2]: root = Node.root()
In [3]: c = root.add('child')
In [4]: c.rename('child')
---------------------------------------------------------------------------
DuplicatePathException Traceback (most recent call last)
/.../eggs/Django-1.5.5-py2.7.egg/django/core/management/commands/shell.pyc in <module>()
----> 1 c.rename('child')
/../src/wheelcms_axle/wheelcms_axle/node.pyc in rename(self, slug, language)
571 if testmode:
572 if Paths.objects.filter(path=newpath, language=language).exists():
--> 573 raise DuplicatePathException(newpath, language)
574 else:
575 for p in Paths.objects.filter(Q(path=localized_path.path) |
DuplicatePathException: (u'/child', 'en')
Reactions are currently unavailable