Latest code throws 'unexpected keyword argument parent_page' in django-modelcluster
See original GitHub issueOK I probably shouldn’t be using the bleeding edge code, but I need some of the 1.4 fixes and features for my project and it was working well before. I’m getting an error with the latest code ever since the commits on Jan 25th to add the new permissions policy. Every time I try to create a new page I get:
Traceback (most recent call last):
File "/Users/matt/Dev/MyProject/MyApp/lib/python3.4/site-packages/django/core/handlers/base.py", line 149, in get_response
response = self.process_exception_by_middleware(e, request)
File "/Users/matt/Dev/MyProject/MyApp/lib/python3.4/site-packages/django/core/handlers/base.py", line 147, in get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/Users/matt/Dev/MyProject/MyApp/lib/python3.4/site-packages/django/views/decorators/cache.py", line 43, in _cache_controlled
response = viewfunc(request, *args, **kw)
File "/Users/matt/Dev/MyProject/MyApp/lib/python3.4/site-packages/django/contrib/auth/decorators.py", line 23, in _wrapped_view
return view_func(request, *args, **kwargs)
File "/Users/matt/Dev/MyProject/MyApp/MyApp/wagtail/wagtailadmin/views/pages.py", line 169, in create
parent_page=parent_page)
File "/Users/matt/Dev/MyProject/MyApp/lib/python3.4/site-packages/modelcluster/forms.py", line 208, in __init__
super(ClusterForm, self).__init__(data, files, instance=instance, prefix=prefix, **kwargs)
TypeError: __init__() got an unexpected keyword argument 'parent_page'
The old code used to call validate_page_form(form, parent_page)
but this has been deleted and replaced by form = form_class(request.POST, request.FILES, instance=page, parent_page=parent_page)
along with the offending parent_page
.
This looks like an accidental bug (possibly triggered by my page models?) but I don’t understand this part of the code well enough to know how to fix it. Any help appreciated, even if it’s “don’t use the latest code yet”.
Thanks!
Issue Analytics
- State:
- Created 8 years ago
- Comments:15 (5 by maintainers)
Top GitHub Comments
Funny that we all encounter the same problem within minutes. I have the same problem.
I have a working fix, though:
-> Use this TabbedInterface instead of the shipped one.
@gasman: can you confirm that this is sufficient or do you see any side effects? AFAIK only the base_form_class must be adjusted.
@everyone: does this work for u as well?
@timheap thanks for this. @kaedroho, can you please review, with the aim of getting it in 1.4.2 in the next few days?