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 @@ -71,8 +71,6 @@ class DatabaseFeatures(BaseDatabaseFeatures):
71
71
"aggregation_regress.tests.AggregationTests.test_aggregation_with_generic_reverse_relation" ,
72
72
# MongoAutoField.get_prep_value() must accept numeric pks.
73
73
"model_forms.tests.ModelFormBasicTests.test_int_pks" ,
74
- # AutoField (IntegerField) validators crash MongoAutoField.
75
- "model_forms.tests.ModelFormBasicTests.test_recleaning_model_form_instance" ,
76
74
}
77
75
# $bitAnd, #bitOr, and $bitXor are new in MongoDB 6.3.
78
76
_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