Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#12281 closed (fixed)

Admin Actions: Display Message on Empty Queryset

Reported by: Paul Smith Owned by: Paul Smith
Component: contrib.admin Version: master
Severity: Keywords: admin actions change-list
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

When a user chooses an action in the Admin's change list (such as, "Delete selected Items") and hits "Go", but no items have been selected, the action function does not fire, and no message is sent to the user. I've noticed that some people have been confused by this. I realize it sounds dumb, but it would be less confusing for users if there were a message created - something like, "Items must be selected in order to perform actions on them. No items have been changed.", when a user clicks Go with nothing selected.

Attachments (1)

admin-action-empty-queryset-12281-patch.diff (3.0 KB) - added by Paul Smith 7 years ago.
Added tests

Download all attachments as: .zip

Change History (11)

comment:1 Changed 7 years ago by Chris Beaven

Triage Stage: UnreviewedAccepted

Sounds fair enough

comment:2 Changed 7 years ago by Chris Beaven

Component: Contrib appsdjango.contrib.admin

comment:3 Changed 7 years ago by Chris Beaven

Triage Stage: AcceptedDesign decision needed

Actually, this is in conflict with #10768

comment:4 Changed 7 years ago by Karen Tracey

Triage Stage: Design decision neededAccepted

This is a better idea than #10768.

comment:5 Changed 7 years ago by Paul Smith

Needs documentation: set
Needs tests: set
Owner: changed from nobody to Paul Smith
Status: newassigned

comment:6 Changed 7 years ago by Paul Smith

Has patch: set
Needs documentation: unset
Needs tests: unset

Added patch that updates ModelAdmin.response_action(). Now a message is sent to the user in the case that:

1) The user chooses an action and clicks go, but no items are selected.
2) Selects items and clicks go without choosing an action.

Changed 7 years ago by Paul Smith

Added tests

comment:7 Changed 7 years ago by Paul Smith

Added tests.

comment:8 Changed 7 years ago by Karen Tracey

Resolution: fixed
Status: assignedclosed

(In [11838]) [1.1.X] Fixed #12281: Added some helpful messages when Go is pressed in admin actions and there
is nothing to do because no action was selected or no items are selected.

r11837 from trunk.

comment:9 Changed 7 years ago by Karen Tracey

(In [11864]) Made the message strings added in r11837 visible to makemessages. Refs #12281.

comment:10 Changed 7 years ago by Karen Tracey

(In [11865]) [1.1.X] Made the message strings added in r11838 visible to makemessages. Refs #12281.

r11864 from trunk.

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