Re: [Django] #26202: Admin Actions: response_action action_index will never work

2016-02-11 Thread Django
#26202: Admin Actions: response_action action_index will never work
---+--
 Reporter:  wengole|Owner:  nobody
 Type:  Bug|   Status:  closed
Component:  contrib.admin  |  Version:  1.9
 Severity:  Normal |   Resolution:  invalid
 Keywords: | Triage Stage:  Unreviewed
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+--
Changes (by timgraham):

 * status:  new => closed
 * resolution:   => invalid


--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/065.91e5c88079dd2cfd0eee65fb85e10a2a%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #26202: Admin Actions: response_action action_index will never work

2016-02-11 Thread Django
#26202: Admin Actions: response_action action_index will never work
---+--
 Reporter:  wengole|Owner:  nobody
 Type:  Bug|   Status:  new
Component:  contrib.admin  |  Version:  1.9
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Unreviewed
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+--

Comment (by wengole):

 This is invalid. Upon further investigation, this is how QueryDict is
 supposed to work. The update() call appends the value at action_index to
 the end of the list. The get() call later in the form's clean() process
 returns the last element in the list.

 There is some weird issue where if I'm using PyCharm's debugger, and break
 before form.is_valid() is called, it will always return False even through
 stepping through the code shows that the POST data is processed correctly
 and should validate the form.

--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/065.983d03919b9af33a25d0d0b37e6af0fd%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #26202: Admin Actions: response_action action_index will never work

2016-02-10 Thread Django
#26202: Admin Actions: response_action action_index will never work
---+--
 Reporter:  wengole|Owner:  nobody
 Type:  Bug|   Status:  new
Component:  contrib.admin  |  Version:  1.9
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Unreviewed
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+--

Comment (by wengole):

 Yes. I've just made the change locally and run the tests and they all
 pass.

 Just looking to write a regression test, then I'll put in a PR

--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/065.d00e8fbd6a87c415ea2205cad45c4838%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #26202: Admin Actions: response_action action_index will never work

2016-02-10 Thread Django
#26202: Admin Actions: response_action action_index will never work
---+--
 Reporter:  wengole|Owner:  nobody
 Type:  Bug|   Status:  new
Component:  contrib.admin  |  Version:  1.9
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Unreviewed
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+--
Changes (by timgraham):

 * needs_better_patch:   => 0
 * needs_tests:   => 0
 * needs_docs:   => 0


Comment:

 Have you tried making your proposed change and checking if any tests fail?

--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/065.eede462da1163892d1a5f370834e81da%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


[Django] #26202: Admin Actions: response_action action_index will never work

2016-02-10 Thread Django
#26202: Admin Actions: response_action action_index will never work
---+
 Reporter:  wengole|  Owner:  nobody
 Type:  Bug| Status:  new
Component:  contrib.admin  |Version:  1.9
 Severity:  Normal |   Keywords:
 Triage Stage:  Unreviewed |  Has patch:  0
Easy pickings:  0  |  UI/UX:  0
---+
 Whilst trying to add action buttons (with name="action" and the action
 name as values) to the change list rows, I stumbled across the problem
 where despite adding a field to the changelist form called "index",
 submitting the form would always fail (even if selecting an action from
 the drop down first).

 By debugging inside django.contrib.admin.options.response_action() I found
 there is some code that attempts to get the action from the request if it
 was in a list.

 {{{#!python
 # Use the action whose button was pushed
 try:
 data.update({'action': data.getlist('action')[action_index]})
 except IndexError:
 # If we didn't get an action from the chosen form that's invalid
 # POST data, so by deleting action it'll fail the validation check
 # below. So no need to do anything here
 pass
 }}}

 The trouble is, data is a QueryDict whose update method (by design) adds
 new value to existing keys by creating or appending to a list. This then
 causes the later form to fail validation.

 I don't see why this needs to be an update, and in fact it should just be
 a key reassignment.

--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/050.622dcc77be152fa6ecc74d0b24b7bd12%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.