Opened 14 years ago

Closed 14 years ago

Last modified 13 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: no UI/UX: no

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 14 years ago.
Initial patch - needs tests, better warnings
modeladmin-13166.diff (8.0 KB ) - added by Paul Smith 14 years ago.
New patch, includes updated tests
modeladmin-13166-js-warnings.diff (17.6 KB ) - added by Paul Smith 14 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 14 years ago.

Download all attachments as: .zip

Change History (12)

by Paul Smith, 14 years ago

Attachment: modeladmin-12962.diff added

Initial patch - needs tests, better warnings

comment:1 by Paul Smith, 14 years ago

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

by Paul Smith, 14 years ago

Attachment: modeladmin-13166.diff added

New patch, includes updated tests

comment:2 by Russell Keith-Magee, 14 years ago

Needs tests: unset
Triage Stage: UnreviewedAccepted

by Paul Smith, 14 years ago

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

comment:3 by Paul Smith, 14 years ago

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 by Jannis Leidel, 14 years ago

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

by Aymeric Augustin, 14 years ago

comment:5 by Aymeric Augustin, 14 years ago

Patch needs improvement: unset

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

comment:6 by Gabriel Hurley, 14 years ago

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 by Jannis Leidel, 14 years ago

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 by Jacob, 13 years ago

milestone: 1.2

Milestone 1.2 deleted

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