Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#16707 closed Cleanup/optimization (wontfix)

Form.is_valid should be a property.

Reported by: Marc Tamlyn Owned by: Marc Tamlyn
Component: Forms Version: master
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


Reasoning: It depends on a property (Form.errors) which is where the work happens. Calling Form.is_valid() twice doesn't validate the form twice. It seems a similar situation to HttpRequest.is_ajax.

See pull request here:

Change History (2)

comment:1 Changed 7 years ago by Malcolm Tredinnick

Resolution: wontfix
Status: newclosed

This would be backwards incompatible. The is_valid() function is part of the public API. There's no strong disadvantage to it being a method call in any case, so let's not over-think it.

comment:2 Changed 7 years ago by Marc Tamlyn

Fair point. It would be a faff to make it backwards compatible. I'll withdraw the pull req. too.

Note: See TracTickets for help on using tickets.
Back to Top