Unable to move pages into the sublevels: 'NoneType' object has no attribute 'allowed_subpage_models'
See original GitHub issueFound a bug? Please fill out the sections below. 👍
Issue Summary
I’m unable to move pages into the sublevels of the other pages.
Steps to Reproduce
Please create the following tree of pages:
root
├── page1
│ └── sub1
└── page2
Try to move sub1
into the page2
. Enjoy the error page.
Technical details
wagtail==1.13.1
Environment:
Request Method: GET
Request URL: http://0.0.0.0:8000/admin/pages/16/move/6/
Django Version: 1.11.9
Python Version: 3.5.3
Installed Applications:
['transit',
'home',
'search',
'wagtail.wagtailforms',
'wagtail.wagtailredirects',
'wagtail.wagtailembeds',
'wagtail.wagtailsites',
'wagtail.wagtailusers',
'wagtail.wagtailsnippets',
'wagtail.wagtaildocs',
'wagtail.wagtailimages',
'wagtail.wagtailsearch',
'wagtail.wagtailadmin',
'wagtail.wagtailcore',
'wagtail.contrib.modeladmin',
'wagtailmenus',
'modelcluster',
'taggit',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'wagtail.contrib.wagtailstyleguide',
'debug_toolbar',
'django_extensions']
Installed Middleware:
['django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'django.middleware.security.SecurityMiddleware',
'wagtail.wagtailcore.middleware.SiteMiddleware',
'wagtail.wagtailredirects.middleware.RedirectMiddleware',
'debug_toolbar.middleware.DebugToolbarMiddleware']
Traceback:
File "/home/narunas/GIT/project/www/pyenv/lib/python3.5/site-packages/django/core/handlers/exception.py" in inner
41. response = get_response(request)
File "/home/narunas/GIT/project/www/pyenv/lib/python3.5/site-packages/django/core/handlers/base.py" in _get_response
187. response = self.process_exception_by_middleware(e, request)
File "/home/narunas/GIT/project/www/pyenv/lib/python3.5/site-packages/django/core/handlers/base.py" in _get_response
185. response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/home/narunas/GIT/project/www/pyenv/lib/python3.5/site-packages/django/views/decorators/cache.py" in _cache_controlled
43. response = viewfunc(request, *args, **kw)
File "/home/narunas/GIT/project/www/pyenv/lib/python3.5/site-packages/wagtail/wagtailadmin/urls/__init__.py" in wrapper
96. return view_func(request, *args, **kwargs)
File "/home/narunas/GIT/project/www/pyenv/lib/python3.5/site-packages/wagtail/wagtailadmin/decorators.py" in decorated_view
31. return view_func(request, *args, **kwargs)
File "/home/narunas/GIT/project/www/pyenv/lib/python3.5/site-packages/wagtail/wagtailadmin/views/pages.py" in move_choose_destination
708. target.can_choose = page_perms.can_move_to(target)
File "/home/narunas/GIT/project/www/pyenv/lib/python3.5/site-packages/wagtail/wagtailcore/models.py" in can_move_to
1804. if not self.page.specific.can_move_to(destination):
File "/home/narunas/GIT/project/www/pyenv/lib/python3.5/site-packages/wagtail/wagtailcore/models.py" in can_move_to
998. return self.can_exist_under(parent)
File "/home/narunas/GIT/project/www/pyenv/lib/python3.5/site-packages/wagtail/wagtailcore/models.py" in can_exist_under
983. return cls in parent.specific_class.allowed_subpage_models()
Exception Type: AttributeError at /admin/pages/16/move/6/
Exception Value: 'NoneType' object has no attribute 'allowed_subpage_models'
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
wagtail - problems after upgrade from 1.13.1 to 2.6.2
Turns out the "home" page hadn't migrated correctly (at all?). Created a new root page, moved "home" under it. Then was able to...
Read more >How To Fix Attribute Error: 'NoneType' Object Has ... - YouTube
Article Link: https://blog.finxter.com/how-to-fix-error- nonetype - object - has - no - attribute -group/ Email Academy: ...
Read more >Pip AttributeError: 'NoneType' object has no attribute 'bytes'
You go to upgrade pip in Python and you get the AttributeError: AttributeError: ' NoneType ' object has no attribute 'bytes'The solution can ......
Read more >Bug #1627363 “[2.1] 'NoneType' object has no attribute 'external ...
2016-09-24 18:41:47 [-] Unhandled failure dispatching AMP command. This is probably a bug. Please ensure that this error is handled within application code ......
Read more >Rearrange pages or sections in Pages on Mac - Apple Support
Note: If individual pages all belong to one section, you can't rearrange individual pages in a word-processing document as described in this task....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This problem occurred because my root page contained other pages created in the app which currently has been disabled in the settings. Re-enabling that app forced wagtail to behave.
I’m closing it as it perhaps is the intended behavior of the wagtail.
The other workaround for this issue, is if you know the pk of the target parent you can just manually construct the move URL.
e.g. if the page you want to move’s pk is 175, the root is 10, and the target is 197, it will check this URL first:
/admin/pages/175/move/10/ <- error
Just edit the URL and replace the 10 with the target’s pk instead (197 in this example), and hit enter:
/admin/pages/175/move/197/ <- will show you the target page and its children, assuming 175 can parent 197. /admin/pages/175/move/197/confirm/ <- will go straight to confirm button to save a click.
A built-in solution that could handle deleted models would be nice, as this workaround causes a lot of confusion for end-users.