#26018: FormMixin.get_context_data calls get_form improperly after form_invalid
-------------------------------+--------------------
Reporter: chmarr | Owner: nobody
Type: Bug | Status: new
Component: Generic views | Version: 1.9
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------
In the fix for ticket #25548, the validated (and failed) form is now
passed in as a parameter to get_context_data. In that code,
self.get_form() is called unnecessarily, which will likely cause a
performance and side-effect penalty equivalent or worse to validating the
form twice.
Solution is to use the "if x not in d" pattern instead of setdefault.
I'll create a pull request.
--
Ticket URL: <https://code.djangoproject.com/ticket/26018>
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/049.37f895911babf531e08c287c19208461%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.