One more EMPTY_VALUES replacement following 22be90dd17
Thanks Loic Bistuer for catching this omission. Refs #19989.
This commit is contained in:
parent
b3aa853ec5
commit
2add24cc2c
|
@ -9,7 +9,6 @@ import django.db.models.manager # Imported to register signal handler.
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.core.exceptions import (ObjectDoesNotExist,
|
from django.core.exceptions import (ObjectDoesNotExist,
|
||||||
MultipleObjectsReturned, FieldError, ValidationError, NON_FIELD_ERRORS)
|
MultipleObjectsReturned, FieldError, ValidationError, NON_FIELD_ERRORS)
|
||||||
from django.core import validators
|
|
||||||
from django.db.models.fields import AutoField, FieldDoesNotExist
|
from django.db.models.fields import AutoField, FieldDoesNotExist
|
||||||
from django.db.models.fields.related import (ManyToOneRel,
|
from django.db.models.fields.related import (ManyToOneRel,
|
||||||
OneToOneField, add_lazy_relation)
|
OneToOneField, add_lazy_relation)
|
||||||
|
@ -940,7 +939,7 @@ class Model(six.with_metaclass(ModelBase)):
|
||||||
# Skip validation for empty fields with blank=True. The developer
|
# Skip validation for empty fields with blank=True. The developer
|
||||||
# is responsible for making sure they have a valid value.
|
# is responsible for making sure they have a valid value.
|
||||||
raw_value = getattr(self, f.attname)
|
raw_value = getattr(self, f.attname)
|
||||||
if f.blank and raw_value in validators.EMPTY_VALUES:
|
if f.blank and raw_value in f.empty_values:
|
||||||
continue
|
continue
|
||||||
try:
|
try:
|
||||||
setattr(self, f.attname, f.clean(raw_value, self))
|
setattr(self, f.attname, f.clean(raw_value, self))
|
||||||
|
|
Loading…
Reference in New Issue