Opened 10 years ago

Last modified 10 years ago

#24710 closed Bug

Replace BaseForm.errors property with get_errors method — at Version 1

Reported by: Artem Rizhov Owned by: nobody
Component: Forms Version: 1.7
Severity: Normal Keywords:
Cc: artem.rizhov@… Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by Artem Rizhov)

This is not a real bug, but it makes some problems. Some kind of Schrödinger's bug.

I think property getter should not do so much changes into the internal state of the object. This getter calls the full_clean method, so this is actually not a getter, but a real worker.

This also produces very annoying side effects on debugging which really look and work like a bug. Please see this stackoverflow question for example
http://stackoverflow.com/questions/12142819/debugging-form-validation-in-pycharm
(sorry for the link to third-party resource, please let me know if you think this text should be copied here)

I propose to replace errors property with get_errors method so that

  • anybody can see it does some work to retrieve the errors
  • debuggers do not try to evaluate it
  • developers do not spend hours for catching non-existent bugs in their apps :)

Change History (1)

comment:1 by Artem Rizhov, 10 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.
Back to Top