From 7cd65aad32c20366b6144dfc21659c7d213d44ce Mon Sep 17 00:00:00 2001 From: Jonathan Sundqvist Date: Tue, 15 Oct 2019 09:42:48 +0200 Subject: [PATCH] Add appropriately named action to unpublish --- djangocms_moderation/admin_actions.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/djangocms_moderation/admin_actions.py b/djangocms_moderation/admin_actions.py index d1585c23..96daf574 100644 --- a/djangocms_moderation/admin_actions.py +++ b/djangocms_moderation/admin_actions.py @@ -1,4 +1,5 @@ from collections import defaultdict +from functools import partial from django.contrib import admin from django.contrib.contenttypes.models import ContentType @@ -153,9 +154,11 @@ def add_items_to_collection(modeladmin, request, queryset): return HttpResponseRedirect(request.META.get("HTTP_REFERER")) -add_items_to_collection.short_description = _( - "Add to moderation collection" -) # noqa: E305 +add_items_to_collection.short_description = _("Add to moderation collection") + +add_item_to_unpublish_collection = partial(add_items_to_collection) +add_item_to_unpublish_collection.__name__ = 'add_item_to_unpublish_collection' +add_item_to_unpublish_collection.short_description = _('Add items to a collection to unpublish') def post_bulk_actions(collection):