Model field validation for IntegerFields does not validate 0 against choices
If a model has an IntegerField with a limited set of choices, the choices will not be checked if the model has the value zero. For instance, given the following model:
class M(models.Model):
number = models.IntegerField(choices=((1, 1),))
M(number=2).full_clean() will raise a ValidationError , while M(number=0).full_clean() will not.
Change History
(5)
| Triage Stage: |
Unreviewed → Accepted
|
| Resolution: |
→ fixed
|
| Status: |
new → closed
|
Fix available at https://github.com/bremac/django/tree/ticket_18724