Reinstate get_snippet_edit_handler with a deprecation warning (#8407)

pull/8413/head
Karl Hobley 2022-04-21 11:50:44 +01:00 zatwierdzone przez GitHub
rodzic 86aa38329d
commit 0d489543b8
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 12 dodań i 0 usunięć

Wyświetl plik

@ -1,3 +1,4 @@
import warnings
from functools import lru_cache
from urllib.parse import urlencode
@ -24,6 +25,7 @@ from wagtail.search.backends import get_search_backend
from wagtail.snippets.action_menu import SnippetActionMenu
from wagtail.snippets.models import get_snippet_models
from wagtail.snippets.permissions import get_permission_name, user_can_edit_snippet_type
from wagtail.utils.deprecation import RemovedInWagtail50Warning
# == Helper functions ==
@ -55,6 +57,16 @@ def get_snippet_panel(model):
return panel.bind_to_model(model)
def get_snippet_edit_handler(model):
get_snippet_panel(model)
warnings.warn(
"The get_snippet_edit_handler function has been renamed to get_snippet_panel",
category=RemovedInWagtail50Warning,
stacklevel=2,
)
# == Views ==