Re: [Django] #18508: Bug in handling out-of-date POST data with inlineformset_factory

2013-10-31 Thread Django
#18508: Bug in handling out-of-date POST data with inlineformset_factory
+
 Reporter:  olau|Owner:  akaariai
 Type:  Bug |   Status:  closed
Component:  Forms   |  Version:  1.4
 Severity:  Normal  |   Resolution:  fixed
 Keywords:  | Triage Stage:  Accepted
Has patch:  1   |  Needs documentation:  0
  Needs tests:  0   |  Patch needs improvement:  0
Easy pickings:  0   |UI/UX:  0
+
Changes (by Anssi Kääriäinen ):

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


Comment:

 In [changeset:"f4f01fb03c2855d42b4d9589c0c090439e02c55b"]:
 {{{
 #!CommitTicketReference repository=""
 revision="f4f01fb03c2855d42b4d9589c0c090439e02c55b"
 Fixed #18508 -- tests for repeated deletion bug in ModelFormSet

 The ticket's issue was already fixed by patch for #14877.
 }}}

-- 
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/062.2e988145a78db075d61096ead8fcafcf%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Django] #18508: Bug in handling out-of-date POST data with inlineformset_factory

2013-10-31 Thread Django
#18508: Bug in handling out-of-date POST data with inlineformset_factory
+
 Reporter:  olau|Owner:  akaariai
 Type:  Bug |   Status:  new
Component:  Forms   |  Version:  1.4
 Severity:  Normal  |   Resolution:
 Keywords:  | Triage Stage:  Accepted
Has patch:  1   |  Needs documentation:  0
  Needs tests:  0   |  Patch needs improvement:  0
Easy pickings:  0   |UI/UX:  0
+

Comment (by olau):

 Thanks for fixing it! It was one of Django's dark corners I guess. I've
 updated the test case to fit in with the other test cases that now exist
 for model formsets (that's nice to see), and sent a pull request
 (https://github.com/django/django/pull/1833).

 I can confirm that without the patch from #14877, the test case fails, and
 with the patch (with latest trunk) everything works. So I think you fixed
 it for good.

-- 
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/062.f0b0f924bbcb87b92f498a08d4e0b2a6%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Django] #18508: Bug in handling out-of-date POST data with inlineformset_factory

2013-10-30 Thread Django
#18508: Bug in handling out-of-date POST data with inlineformset_factory
+
 Reporter:  olau|Owner:  akaariai
 Type:  Bug |   Status:  new
Component:  Forms   |  Version:  1.4
 Severity:  Normal  |   Resolution:
 Keywords:  | Triage Stage:  Accepted
Has patch:  1   |  Needs documentation:  0
  Needs tests:  0   |  Patch needs improvement:  0
Easy pickings:  0   |UI/UX:  0
+

Comment (by akaariai):

 I think #14877's patch (https://github.com/django/django/pull/1829) will
 take care of this ticket, too. Can you confirm? If you are going to
 confirm this, a tests-only patch would be very welcome...

-- 
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/062.76f60d97d790b0db906382ad83694d55%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Django] #18508: Bug in handling out-of-date POST data with inlineformset_factory

2013-10-30 Thread Django
#18508: Bug in handling out-of-date POST data with inlineformset_factory
+
 Reporter:  olau|Owner:  akaariai
 Type:  Bug |   Status:  new
Component:  Forms   |  Version:  1.4
 Severity:  Normal  |   Resolution:
 Keywords:  | Triage Stage:  Accepted
Has patch:  1   |  Needs documentation:  0
  Needs tests:  0   |  Patch needs improvement:  0
Easy pickings:  0   |UI/UX:  0
+

Comment (by olau):

 I just noticed I had still the code for this lying around. Is there any
 chance you'll have time to look at it again? The bug itself is a trivial
 oversight so it's a one-line fix.

-- 
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/062.ac3d195a5f30f49a1e422e133aa896e0%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Django] #18508: Bug in handling out-of-date POST data with inlineformset_factory

2012-12-19 Thread Django
#18508: Bug in handling out-of-date POST data with inlineformset_factory
+
 Reporter:  olau|Owner:  akaariai
 Type:  Bug |   Status:  new
Component:  Forms   |  Version:  1.4
 Severity:  Normal  |   Resolution:
 Keywords:  | Triage Stage:  Accepted
Has patch:  1   |  Needs documentation:  0
  Needs tests:  0   |  Patch needs improvement:  0
Easy pickings:  0   |UI/UX:  0
+
Changes (by akaariai):

 * owner:  nobody => akaariai


Comment:

 For what it is worth I just got hit by this issue.

 I will try to work on this.

-- 
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 post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Django] #18508: Bug in handling out-of-date POST data with inlineformset_factory

2012-11-14 Thread Django
#18508: Bug in handling out-of-date POST data with inlineformset_factory
+
 Reporter:  olau|Owner:  nobody
 Type:  Bug |   Status:  new
Component:  Forms   |  Version:  1.4
 Severity:  Normal  |   Resolution:
 Keywords:  | Triage Stage:  Accepted
Has patch:  1   |  Needs documentation:  0
  Needs tests:  0   |  Patch needs improvement:  0
Easy pickings:  0   |UI/UX:  0
+
Changes (by olau):

 * has_patch:  0 => 1


-- 
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 post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Django] #18508: Bug in handling out-of-date POST data with inlineformset_factory

2012-11-14 Thread Django
#18508: Bug in handling out-of-date POST data with inlineformset_factory
+
 Reporter:  olau|Owner:  nobody
 Type:  Bug |   Status:  new
Component:  Forms   |  Version:  1.4
 Severity:  Normal  |   Resolution:
 Keywords:  | Triage Stage:  Accepted
Has patch:  0   |  Needs documentation:  0
  Needs tests:  0   |  Patch needs improvement:  0
Easy pickings:  0   |UI/UX:  0
+

Comment (by olau):

 Thanks! I can see now that my description is a bit cryptic. Basically, the
 problem here is a concurrency problem.

 If you post a formset, Django is supposed to use another branch of the
 code to match each individual form with its object because you can't
 assume that a POSTed formset[i] corresponds to get_queryset()[i] - an
 element could have been added/deleted or the ordering changed.

 Unfortunately, there's a trivial bug in this logic so it fails if one of
 the elements has been deleted.

 I only noticed this because there was a Javascript bug in a site I've been
 doing maintenance for, so people would sometimes end up double-POSTing a
 delete, causing a mysterious crash. This patch and the patch in #14877
 fixed it. You can still get concurrency issues but can at least deal with
 it yourself (e.g. through form validation) since Django passes the data on
 to you rather than crashing. :)

-- 
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 post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Django] #18508: Bug in handling out-of-date POST data with inlineformset_factory

2012-11-13 Thread Django
#18508: Bug in handling out-of-date POST data with inlineformset_factory
+
 Reporter:  olau|Owner:  nobody
 Type:  Bug |   Status:  new
Component:  Forms   |  Version:  1.4
 Severity:  Normal  |   Resolution:
 Keywords:  | Triage Stage:  Accepted
Has patch:  0   |  Needs documentation:  0
  Needs tests:  0   |  Patch needs improvement:  0
Easy pickings:  0   |UI/UX:  0
+
Changes (by aaugustin):

 * needs_better_patch:   => 0
 * needs_docs:   => 0
 * needs_tests:   => 0
 * stage:  Unreviewed => Accepted


Comment:

 Accepting because there's a patch with a test case. I'm not very familiar
 with formsets, though.

-- 
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 post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[Django] #18508: Bug in handling out-of-date POST data with inlineformset_factory

2012-06-22 Thread Django
#18508: Bug in handling out-of-date POST data with inlineformset_factory
+
 Reporter:  olau|  Owner:  nobody
 Type:  Bug | Status:  new
Component:  Forms   |Version:  1.4
 Severity:  Normal  |   Keywords:
 Triage Stage:  Unreviewed  |  Has patch:  0
Easy pickings:  0   |  UI/UX:  0
+
 Hi, there's a bug in BaseModelFormSet._construct_form. There's a guard
 supposed to take care of bound forms, but if one of the entries has been
 deleted, self._existing_object(pk) will return None so you can end up in

 {{{
 if i < self.initial_form_count() and not kwargs.get('instance'):
 kwargs['instance'] = self.get_queryset()[i]
 }}}

 which is dangerous for a bound form where you must use ids to identify
 elements since element "i" can have changed from when the form was
 generated. In my case, I got an IndexError because there weren't enough
 elements left from a recent deletion.

 I think the correct fix is to change the "if" to an "elif".

 I've attached a patch with this fix and a test case for reproducing the
 problem (there doesn't seem to be any tests of model formsets?).

 Note that the test as entered doesn't pass even with the fix because of
 issue #14877 - if you delete formset.save() and below in the test, it does
 pass.

-- 
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 post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.