Commit bd91c18 1 parent 730adc3 commit bd91c18 Copy full SHA for bd91c18
File tree 2 files changed +3
-3
lines changed
2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -263,7 +263,7 @@ impl ModelValidator {
263
263
let output = self . validator . validate ( py, input, state) ?;
264
264
265
265
if self . root_model {
266
- let fields_set = if input. to_object ( py ) . is ( & self . undefined ) {
266
+ let fields_set = if input. as_python ( ) . is_some_and ( |py_input| py_input . is ( & self . undefined ) ) {
267
267
PySet :: empty ( py) ?
268
268
} else {
269
269
PySet :: new ( py, [ & String :: from ( ROOT_FIELD ) ] ) ?
@@ -304,7 +304,7 @@ impl ModelValidator {
304
304
let instance = create_class ( self . class . bind ( py) ) ?;
305
305
306
306
if self . root_model {
307
- let fields_set = if input. to_object ( py ) . is ( & self . undefined ) {
307
+ let fields_set = if input. as_python ( ) . is_some_and ( |py_input| py_input . is ( & self . undefined ) ) {
308
308
PySet :: empty ( py) ?
309
309
} else {
310
310
PySet :: new ( py, [ & String :: from ( ROOT_FIELD ) ] ) ?
Original file line number Diff line number Diff line change @@ -157,7 +157,7 @@ impl Validator for WithDefaultValidator {
157
157
input : & ( impl Input < ' py > + ?Sized ) ,
158
158
state : & mut ValidationState < ' _ , ' py > ,
159
159
) -> ValResult < PyObject > {
160
- if input. to_object ( py ) . is ( & self . undefined ) {
160
+ if input. as_python ( ) . is_some_and ( |py_input| py_input . is ( & self . undefined ) ) {
161
161
Ok ( self . default_value ( py, None :: < usize > , state) ?. unwrap ( ) )
162
162
} else {
163
163
match self . validator . validate ( py, input, state) {
You can’t perform that action at this time.
0 commit comments