Opened 12 years ago

Closed 11 years ago

#5708 closed (invalid)

validate() returns 'This field is required.' for number fields if number is Zero

Reported by: florian.leitner@… Owned by: nobody
Component: Core (Other) Version: 0.96
Severity: Keywords: validate zero number
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


in in line 116 change:

if not self.blank and not field_data:


if not self.blank and field_data is None:

Change History (2)

comment:1 Changed 12 years ago by Malcolm Tredinnick

Triage Stage: UnreviewedAccepted

Model validation hasn't been fully implemented yet, and that's the only thing that should be calling Field.validate_full() at the moment. This will be fixed at that time.

The suggested fix isn't completely correct, since, for example, an empty string isn't valid there either.

For anybody reading this in the near future, the area that needs changing is Field.validate_full(), which isn't line 116 any longer.

comment:2 Changed 11 years ago by Karen Tracey

Resolution: invalid
Status: newclosed

This code was removed in [8348]. Can't really call it fixed since #6845 isn't integrated yet, but its patch doesn't appear to have this problem. At any rate the code mentioned here no longer exists so there's nothing to fix for this ticket.

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