#26018: FormMixin.get_context_data calls get_form improperly after form_invalid
-------------------------------------+-------------------------------------
     Reporter:  chmarr               |                    Owner:  chmarr
         Type:  Bug                  |                   Status:  closed
    Component:  Generic views        |                  Version:  1.9
     Severity:  Normal               |               Resolution:  fixed
     Keywords:                       |             Triage Stage:  Ready for
                                     |  checkin
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by Tim Graham <timograham@…>):

 In [changeset:"8202ce45a5ae5dac2c6fdf94bf3554180bbdd7b7" 8202ce45]:
 {{{
 #!CommitTicketReference repository=""
 revision="8202ce45a5ae5dac2c6fdf94bf3554180bbdd7b7"
 [1.9.x] Fixed #26018 -- Prevented unecessary get_form() call in
 FormMixin.get_context_data().

 Changed "dict.setdefault" to "if x in dict" pattern so that get_form()
 would not
 be called unnecessarily, specifically in the case where
 FormMixin.form_invalid()
 calls get_context_data() with the current form.

 Backport of e429c5186ceed81c4627165518e0c70c58e69595 from master
 }}}

--
Ticket URL: <https://code.djangoproject.com/ticket/26018#comment:6>
Django <https://code.djangoproject.com/>
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/064.8aa87485a01bd8a14ce4578ea052c1ad%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to