Opened 4 years ago

Closed 4 years ago

#31889 closed Bug (invalid)

Django actions

Reported by: Sleiman Bassim Owned by: anujpandey785
Component: Documentation Version: 3.1
Severity: Normal Keywords: actions
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

Hi,

In the Admin actions documentation https://docs.djangoproject.com/en/3.1/ref/contrib/admin/actions/

make_published.short_description should be self.short_description

Context:

class ArticleAdmin(admin.ModelAdmin):
    ...

    actions = ['make_published']

    def make_published(self, request, queryset):
        queryset.update(status='p')
    make_published.short_description = "Mark selected stories as published"

Change History (2)

comment:1 by anujpandey785, 4 years ago

Owner: changed from nobody to anujpandey785
Status: newassigned

comment:2 by Sage Abdullah, 4 years ago

Resolution: invalid
Status: assignedclosed

The docs are correct, we're setting short_description to the admin action, not the ModelAdmin instance itself.

Note: See TracTickets for help on using tickets.
Back to Top