﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
3489	Altering self.fields in Form.__init__() fails	Ronny Pfannschmidt	Jonathan Buchanan	"take a look at the test
{{{
#!python
""""""
>>> TestForm({'text':""foo""}).is_valid()
True

>>> TestForm({'text':""foo""},need_name=True).is_valid()
False

>>> TestForm({'text':""foo""}).is_valid() #this one will fail
True

""""""
from django.newforms import *
class TestForm(Form):
    name = CharField(max_length=30)
    text = CharField(widget=Textarea)
    def __init__(self,*k,**kw):
        need_name=kw.pop(""need_name"",False)
        Form.__init__(self,*k,**kw)

        if need_name:
            self.fields[""name""].required=True
}}}

Just assigning {{{need_name}}} to {{{self.fields[""name""].required}}} would create a race condition for multithreaded servers."		closed	Forms	dev		fixed			Accepted	1	0	0	0	0	0
