Skip to content

Commit

Permalink
change menuitem inherit class.
Browse files Browse the repository at this point in the history
  • Loading branch information
FreemanPancake committed Oct 29, 2024
1 parent 376b457 commit 31577f9
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions djangocms_navigation/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@
from djangocms_versioning.models import Version
from treebeard.admin import TreeAdmin

from cms.admin.utils import ChangeListActionsMixin

from .compat import TREEBEARD_4_5
from .conf import TREE_MAX_RESULT_PER_PAGE_COUNT
from .filters import LanguageFilter
Expand All @@ -41,12 +39,16 @@
from .compat import CMS_41


menuitem_admin_class = [TreeAdmin]

try:
if CMS_41:
from cms.admin.utils import ChangeListActionsMixin
from djangocms_versioning.helpers import (
content_is_unlocked_for_user,
version_is_locked,
)
menuitem_admin_class.insert(0, ChangeListActionsMixin)
else:
from djangocms_version_locking.helpers import (
content_is_unlocked_for_user,
Expand All @@ -55,8 +57,7 @@

using_version_lock = True
LOCK_MESSAGE = _(
"The item is currently locked or you don't "
"have permission to change it"
"The item is currently locked or you don't have permission to change it"
)
except ImportError:
using_version_lock = False
Expand Down Expand Up @@ -276,7 +277,7 @@ def get_menuitem_link(self, obj):


@admin.register(MenuItem)
class MenuItemAdmin(ChangeListActionsMixin, TreeAdmin):
class MenuItemAdmin(*menuitem_admin_class):
form = MenuItemForm
menu_content_model = MenuContent
menu_model = Menu
Expand Down

0 comments on commit 31577f9

Please sign in to comment.