forked from ungleich-public/dynamicweb
Fix aldryn-categories admin with treebeard 7
treebeard 7 renamed the move form fields to treebeard_position and treebeard_ref_node; the category add form raised FieldError.
This commit is contained in:
parent
c9cbcc9d55
commit
5fcdeb60d5
1 changed files with 13 additions and 0 deletions
|
|
@ -87,3 +87,16 @@ class CompatConfig(AppConfig):
|
|||
return response
|
||||
|
||||
BasePageAdmin.changelist_view = changelist_view_with_cl
|
||||
|
||||
# django-treebeard 7 renamed the form fields "_position" and
|
||||
# "_ref_node_id" to "treebeard_position" and "treebeard_ref_node";
|
||||
# aldryn-categories still lists the old names in its admin.
|
||||
from aldryn_categories.admin import CategoryAdmin
|
||||
from parler.admin import TranslatableAdmin
|
||||
|
||||
CategoryAdmin.fieldsets = (
|
||||
(None, {'fields': ('name', 'slug')}),
|
||||
(' ', {'fields': ('treebeard_position', 'treebeard_ref_node')}),
|
||||
)
|
||||
CategoryAdmin.get_form = lambda self, request, obj=None, **kwargs: (
|
||||
TranslatableAdmin.get_form(self, request, obj, **kwargs))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue