I'm doing this because there's a problem in my code. I create a AuthenticationForm, and post a non-existing username and password, and call is_valid(). I expect to then that the errors property will return at least one error, but there are actually no errors. So I step through the debugger, and see that full_clean() is not getting called, because _errors apparently is never None, even after setting it to None in the BaseForm constructor.
I agree with you that I'm sure such a bug doesn't exist. But I can't understand at all why it looks like this in the debugger. How can the code set a variable to None, and it is set to an empty ErrorDict? It seems like a practical joke or something. On Sep 20, 4:55 pm, Shawn Milochik <sh...@milochik.com> wrote: > On Tue, Sep 20, 2011 at 4:46 PM, Jacob G <ja...@fareclock.com> wrote: > > I doubt I'm familiar enough with Django to fix bugs. > > Wait until the talks from DjangoCon US 2011 are out, then watch my > lightning talk. I guarantee you could submit at least three patches > today alone. > > > I am puzzled by what I am see though with the BaseForm class in Aptana > > PyDev debugger. I noticed that full_clean() was not being called via a > > call to is_valid. So I stepped through the debugger, and for some > > strange reason, the BaseForm constructor, although the code says > > "self._errors = None" the debugger watchlist shows self._errors as set > > to an empty ErrorDict, and therefore the _get_errors() method never > > called full_clean(). > > > Does this make any sense? It doesn't sound right. > > I haven't dug into this particular code, so I don't know why it works > that way. In any case, what is it that you're actually trying to > accomplish? I ask because I'm pretty sure Django form validation isn't > buggy or we'd know by now. If you're just trying to understand Django > then that's awesome, and I hope you figure it out or someone helps > out. But if you're digging into it to try to solve a problem in your > own code, what is it? > > Shawn -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.