﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
36842	HTML validation of non-float values in admin number widgets allows submitting invalid entries to succeed if blank=True	pawel-steto	Vishy Algo	"Hello,

Having the following model and associated admin:

{{{
from django.db import models

class FooBar(models.Model):
    float_req = models.FloatField()
    float_not_req = models.FloatField(null=True, blank=True)
}}}

{{{
from django.contrib import admin

from .models import FooBar

admin.site.register(FooBar)
}}}

If you:
1. Create an entry with both float fields set
2. In django admin, edit the float_not_req field entering an invalid float (a string for example)
3. Save the model

No issue is shown, the value of the field is overridden and set to None

But If you do the same for the required float field, a validation error is raised and the field is not overridden.

I know it is possible to change this behavior overriding the save/clean logic in django admin but I think this is misleading.

Have a nice day,
Pawel


"	New feature	closed	contrib.admin	6.0	Normal	wontfix	admin validation floatfield blank input number	pawel-steto	Unreviewed	0	0	0	0	0	0
