From 0fcd6d8cc10c8096f15074d2dec1f8d96e88b0fa Mon Sep 17 00:00:00 2001 From: Bertrand Bordage Date: Thu, 29 Mar 2018 21:01:23 +0200 Subject: [PATCH] Improves #4421 documentation example. --- docs/reference/hooks.rst | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/docs/reference/hooks.rst b/docs/reference/hooks.rst index b281efac16..1e6d346387 100644 --- a/docs/reference/hooks.rst +++ b/docs/reference/hooks.rst @@ -125,25 +125,21 @@ Hooks for building new areas of the admin interface (alongside pages, images, do ``register_account_menu_item`` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Add an item to the My Account page within the Wagtail admin. The callable - for this hook should return a dict with values for the keys ``url``, - ``label`` and ``help_text``. For example: + Add an item to the “Account settings” page within the Wagtail admin. + The callable for this hook should return a dict with the keys + ``url``, ``label`` and ``help_text``. For example: .. code-block:: python - from django.utils.translation import ugettext_lazy as _ + from django.urls import reverse from wagtail.core import hooks @hooks.register('register_account_menu_item') - def register_account_set_gravatar(request): + def register_account_delete_account(request): return { - 'url': 'https://gravatar.com/emails/', - 'label': _('Set gravatar'), - 'help_text': _( - "Your avatar image is provided by Gravatar and is connected to " - "your email address. With a Gravatar account you can set an " - "avatar for any number of other email addresses you use." - ) + 'url': reverse('delete-account'), + 'label': 'Delete account', + 'help_text': 'This permanently deletes your account.' }