File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -83,8 +83,6 @@ class DatabaseFeatures(BaseDatabaseFeatures):
83
83
"model_forms.test_modelchoicefield.ModelChoiceFieldTests.test_clean_model_instance" ,
84
84
# MongoAutoField.get_prep_value() must accept numeric pks.
85
85
"model_forms.tests.ModelFormBasicTests.test_int_pks" ,
86
- # AutoField (IntegerField) validators crash MongoAutoField.
87
- "model_forms.tests.ModelFormBasicTests.test_recleaning_model_form_instance" ,
88
86
}
89
87
# $bitAnd, #bitOr, and $bitXor are new in MongoDB 6.3.
90
88
_django_test_expected_failures_bitwise = {
Original file line number Diff line number Diff line change 1
1
from bson import ObjectId , errors
2
2
from django .core import exceptions
3
3
from django .db .models .fields import AutoField , Field
4
+ from django .utils .functional import cached_property
4
5
from django .utils .translation import gettext_lazy as _
5
6
6
7
@@ -41,3 +42,8 @@ def to_python(self, value):
41
42
code = "invalid" ,
42
43
params = {"value" : value },
43
44
) from None
45
+
46
+ @cached_property
47
+ def validators (self ):
48
+ # Avoid IntegerField validators inherited from AutoField.
49
+ return [* self .default_validators , * self ._validators ]
You can’t perform that action at this time.
0 commit comments