Code

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#12281 closed (fixed)

Admin Actions: Display Message on Empty Queryset

Reported by: blinkylights Owned by: blinkylights
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 blinkylights 5 years ago.
Added tests

Download all attachments as: .zip

Change History (11)

comment:1 Changed 5 years ago by SmileyChris

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

Sounds fair enough

comment:2 Changed 5 years ago by SmileyChris

  • Component changed from Contrib apps to django.contrib.admin

comment:3 Changed 5 years ago by SmileyChris

  • Triage Stage changed from Accepted to Design decision needed

Actually, this is in conflict with #10768

comment:4 Changed 5 years ago by kmtracey

  • Triage Stage changed from Design decision needed to Accepted

This is a better idea than #10768.

comment:5 Changed 5 years ago by blinkylights

  • Needs documentation set
  • Needs tests set
  • Owner changed from nobody to blinkylights
  • Status changed from new to assigned

comment:6 Changed 5 years ago by blinkylights

  • 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 5 years ago by blinkylights

Added tests

comment:7 Changed 5 years ago by blinkylights

Added tests.

comment:8 Changed 5 years ago by kmtracey

  • Resolution set to fixed
  • Status changed from assigned to closed

(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 5 years ago by kmtracey

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

comment:10 Changed 5 years ago by kmtracey

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

r11864 from trunk.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.