Add CustomAccessibilityItem with all non-experimental rules enabled

pull/414/head
Sage Abdullah 2023-05-15 12:43:46 +01:00 zatwierdzone przez Matt Westcott
rodzic cfc3338abb
commit 390cc6b71b
1 zmienionych plików z 13 dodań i 0 usunięć

Wyświetl plik

@ -1,4 +1,5 @@
from wagtail import hooks
from wagtail.admin.userbar import AccessibilityItem
from wagtail.contrib.modeladmin.options import (
ModelAdmin,
ModelAdminGroup,
@ -35,6 +36,18 @@ def register_icons(icons):
]
class CustomAccessibilityItem(AccessibilityItem):
axe_run_only = None
@hooks.register("construct_wagtail_userbar")
def replace_userbar_accessibility_item(request, items):
items[:] = [
CustomAccessibilityItem() if isinstance(item, AccessibilityItem) else item
for item in items
]
class BreadIngredientAdmin(ModelAdmin):
# These stub classes allow us to put various models into the custom "Wagtail Bakery" menu item
# rather than under the default Snippets section.