File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -263,7 +263,7 @@ impl ModelValidator {
263263 let output = self . validator . validate ( py, input, state) ?;
264264
265265 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 ) ) {
267267 PySet :: empty ( py) ?
268268 } else {
269269 PySet :: new ( py, [ & String :: from ( ROOT_FIELD ) ] ) ?
@@ -304,7 +304,7 @@ impl ModelValidator {
304304 let instance = create_class ( self . class . bind ( py) ) ?;
305305
306306 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 ) ) {
308308 PySet :: empty ( py) ?
309309 } else {
310310 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 {
157157 input : & ( impl Input < ' py > + ?Sized ) ,
158158 state : & mut ValidationState < ' _ , ' py > ,
159159 ) -> 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 ) ) {
161161 Ok ( self . default_value ( py, None :: < usize > , state) ?. unwrap ( ) )
162162 } else {
163163 match self . validator . validate ( py, input, state) {
You can’t perform that action at this time.
0 commit comments