Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error with self.node.get_last_child()._inc_path() #140

Closed
pavlo-mk opened this issue May 21, 2019 · 4 comments · May be fixed by #235
Closed

error with self.node.get_last_child()._inc_path() #140

pavlo-mk opened this issue May 21, 2019 · 4 comments · May be fixed by #235

Comments

@pavlo-mk
Copy link

pavlo-mk commented May 21, 2019

I get error with this line code
treebeard/mp_tree.py:387
newobj.path = self.node.get_last_child()._inc_path()

'NoneType' object has no attribute '_inc_path'

self have parent object page and in kwargs is instance.

backend_1 | Traceback (most recent call last): backend_1 | File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 34, in inner backend_1 | response = get_response(request) backend_1 | File "/usr/local/lib/python3.6/site-packages/django/core/handlers/base.py", line 115, in _get_response backend_1 | response = self.process_exception_by_middleware(e, request) backend_1 | File "/usr/local/lib/python3.6/site-packages/django/core/handlers/base.py", line 113, in _get_response backend_1 | response = wrapped_callback(request, *callback_args, **callback_kwargs) backend_1 | File "/usr/local/lib/python3.6/site-packages/django/views/decorators/cache.py", line 31, in _cache_controlled backend_1 | response = viewfunc(request, *args, **kw) backend_1 | File "/usr/local/lib/python3.6/site-packages/django/contrib/auth/decorators.py", line 21, in _wrapped_view backend_1 | return view_func(request, *args, **kwargs) backend_1 | File "/opt/project/pv/apps/wagtailoverrides/views/pages.py", line 246, in create backend_1 | parent_page.add_child(instance=page) backend_1 | File "/usr/local/lib/python3.6/site-packages/treebeard/mp_tree.py", line 1013, in add_child backend_1 | return MP_AddChildHandler(self, **kwargs).process() backend_1 | File "/usr/local/lib/python3.6/site-packages/treebeard/mp_tree.py", line 387, in process backend_1 | newobj.path = self.node.get_last_child()._inc_path() backend_1 | AttributeError: 'NoneType' object has no attribute '_inc_path' backend_1 | [21/May/2019 09:03:28] "POST /admin/pages/new/article/articlepage/5/ HTTP/1.1" 500 110440

tech info:
python 3.6
Django 2.2.1
wagtail 2.5.1
django-treebeard 4.3
image

@pinksharpii
Copy link

Did you figure out what the issue was? I'm having the same issue. Updating to 3.4.1 did not help.

@graingert
Copy link

image

@graingert
Copy link

#220 related?

@hazho
Copy link

hazho commented Oct 2, 2021

I think I'll solve this one today

hazho added a commit to hazho/django-treebeard that referenced this issue Oct 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants