Opened 5 years ago

Closed 5 years ago

Last modified 3 years ago

#13166 closed (fixed)

Admin change view: ambiguity between action and list_editable form submission

Reported by: blinkylights Owned by: blinkylights
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 blinkylights 5 years ago.
Initial patch - needs tests, better warnings
modeladmin-13166.diff (8.0 KB) - added by blinkylights 5 years ago.
New patch, includes updated tests
modeladmin-13166-js-warnings.diff (17.6 KB) - added by blinkylights 5 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 aaugustin 5 years ago.

Download all attachments as: .zip

Change History (12)

Changed 5 years ago by blinkylights

Initial patch - needs tests, better warnings

comment:1 Changed 5 years ago by blinkylights

  • Needs documentation unset
  • Needs tests set
  • Patch needs improvement set
  • Status changed from new to assigned

Changed 5 years ago by blinkylights

New patch, includes updated tests

comment:2 Changed 5 years ago by russellm

  • Needs tests unset
  • Triage Stage changed from Unreviewed to Accepted

Changed 5 years ago by blinkylights

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

comment:3 Changed 5 years ago by blinkylights

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

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

comment:5 Changed 5 years ago by aaugustin

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

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

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

(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 3 years ago by jacob

  • milestone 1.2 deleted

Milestone 1.2 deleted

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