From 6d19adf6fe57e3fac167008ab570fb6eb085a253 Mon Sep 17 00:00:00 2001 From: Andy Chosak Date: Wed, 6 Jan 2021 11:52:38 -0500 Subject: [PATCH 1/2] Add newly added next_url parameter to hook As of version 2.10, certain Wagtail hooks new accept an optional next_url keyword argument. [0] This includes the register_page_listing_more_buttons hook used in this project. Users of Wagail 2.10 and 2.11 currently see this deprecation warning: > RemovedInWagtail212Warning: register_page_listing_more_buttons hooks > will require an additional kwarg `next_url` in a future release. Please > update your hook function to accept `next_url`. This commit fixes that warning while still maintaining compatibility with the older versions of Wagtail. [0] https://docs.wagtail.io/en/stable/releases/2.10.html#new-next-url-keyword-argument-on-register-page-listing-buttons-and-register-page-listing-more-buttons-hooks --- wagtailsharing/wagtail_hooks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wagtailsharing/wagtail_hooks.py b/wagtailsharing/wagtail_hooks.py index b1bc924..3c766ea 100644 --- a/wagtailsharing/wagtail_hooks.py +++ b/wagtailsharing/wagtail_hooks.py @@ -25,7 +25,7 @@ class SharingSiteModelAdmin(ModelAdmin): @hooks.register("register_page_listing_more_buttons") -def add_sharing_link(page, page_perms, is_parent=False): +def add_sharing_link(page, page_perms, is_parent=False, next_url=None): sharing_url = get_sharing_url(page) if sharing_url: From f7404aab5fb94a64b967ed06b26b8b9e30baf3f6 Mon Sep 17 00:00:00 2001 From: Andy Chosak Date: Wed, 6 Jan 2021 11:55:19 -0500 Subject: [PATCH 2/2] Minor doc improvement to running manage.py --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 08dbe82..e0b269b 100644 --- a/README.rst +++ b/README.rst @@ -48,7 +48,7 @@ Run migrations to create required database tables: .. code-block:: bash - $ manage.py migrate wagtailsharing + $ python manage.py migrate wagtailsharing Replace use of Wagtail's catch-all URL pattern: