Opened 14 years ago

Closed 14 years ago

Last modified 14 years ago

#12281 closed (fixed)

Admin Actions: Display Message on Empty Queryset

Reported by: Paul Smith Owned by: Paul Smith
Component: contrib.admin Version: dev
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: no UI/UX: no

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 14 years ago.
Added tests

Download all attachments as: .zip

Change History (11)

comment:1 by Chris Beaven, 14 years ago

Triage Stage: UnreviewedAccepted

Sounds fair enough

comment:2 by Chris Beaven, 14 years ago

Component: Contrib appsdjango.contrib.admin

comment:3 by Chris Beaven, 14 years ago

Triage Stage: AcceptedDesign decision needed

Actually, this is in conflict with #10768

comment:4 by Karen Tracey, 14 years ago

Triage Stage: Design decision neededAccepted

This is a better idea than #10768.

comment:5 by Paul Smith, 14 years ago

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

comment:6 by Paul Smith, 14 years ago

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.

by Paul Smith, 14 years ago

Added tests

comment:7 by Paul Smith, 14 years ago

Added tests.

comment:8 by Karen Tracey, 14 years ago

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 by Karen Tracey, 14 years ago

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

comment:10 by Karen Tracey, 14 years ago

(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