Opened 7 years ago

Closed 6 years ago

Last modified 5 years ago

#13166 closed (fixed)

Admin change view: ambiguity between action and list_editable form submission

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

Description

The Admin change view can have two simultaneous form interactions if there are actions AND there are list_editable fields. There will be two submit buttons: a 'Go' button for actions and a 'Save' button for list_editable changes (actually it could be three if actions_on_top and actions_on_bottom are both True). In cases where the user might change list_editable elements and hit the 'Go' button, or select an action to execute and hit 'Save', BOTH sets of changes get handled - an ambiguous and confusing situation that could potentially result in unintended consequences.

Attachments (4)

modeladmin-12962.diff (3.5 KB) - added by Paul Smith 7 years ago.
Initial patch - needs tests, better warnings
modeladmin-13166.diff (8.0 KB) - added by Paul Smith 7 years ago.
New patch, includes updated tests
modeladmin-13166-js-warnings.diff (17.6 KB) - added by Paul Smith 7 years ago.
New patch: includes additions to actions.js that warn users when they're submitting ambiguous values.
modeladmin-13166-js-warnings-i18n.diff (16.2 KB) - added by Aymeric Augustin 6 years ago.

Download all attachments as: .zip

Change History (12)

Changed 7 years ago by Paul Smith

Attachment: modeladmin-12962.diff added

Initial patch - needs tests, better warnings

comment:1 Changed 7 years ago by Paul Smith

Needs documentation: unset
Needs tests: set
Patch needs improvement: set
Status: newassigned

Changed 7 years ago by Paul Smith

Attachment: modeladmin-13166.diff added

New patch, includes updated tests

comment:2 Changed 7 years ago by Russell Keith-Magee

Needs tests: unset
Triage Stage: UnreviewedAccepted

Changed 7 years ago by Paul Smith

New patch: includes additions to actions.js that warn users when they're submitting ambiguous values.

comment:3 Changed 7 years ago by Paul Smith

Patch needs improvement: unset

OK, now we have some tests, old tests have been updated, and there are some JavaScript warnings that will let the user know when they submit ambiguous values. Changing "Needs improvement" - ready to go.

comment:4 Changed 6 years ago by Jannis Leidel

Patch needs improvement: set

The confirmation messages ought to be marked for translation, as documented here: http://docs.djangoproject.com/en/1.1/topics/i18n/internationalization/#specifying-translation-strings-in-javascript-code

Changed 6 years ago by Aymeric Augustin

comment:5 Changed 6 years ago by Aymeric Augustin

Patch needs improvement: unset

Updated patch that applies cleanly on r13045, with i18n added in javascript and minification, as required by jezdez.

comment:6 Changed 6 years ago by Gabriel Hurley

I tested aaugustin's latest patch on my Windows XP system: it applies cleanly, the tests pass, and interacting with the list-editable/actions widgets produce what seem to be the correct set of confirmation dialogs and messages. Looks ok to me.

comment:7 Changed 6 years ago by Jannis Leidel

Resolution: fixed
Status: assignedclosed

(In [13072]) Fixed #13166 - Added JavaScript warnings to admin changelist to help against ambiguity between action and list_editable form submission. Thanks to blinkylights and aaugustin for the report and initial patch.

comment:8 Changed 5 years ago by Jacob

milestone: 1.2

Milestone 1.2 deleted

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