File tree Expand file tree Collapse file tree 1 file changed +1
-2
lines changed Expand file tree Collapse file tree 1 file changed +1
-2
lines changed Original file line number Diff line number Diff line change @@ -125,8 +125,6 @@ impl Validator for ModelFieldsValidator {
125125        // this validator does not yet support partial validation, disable it to avoid incorrect results 
126126        state. allow_partial  = false . into ( ) ; 
127127
128-         let  deprecation_warning_type = py. import_bound ( "builtins" ) ?. getattr ( "DeprecationWarning" ) ?; 
129- 
130128        let  strict = state. strict_or ( self . strict ) ; 
131129        let  from_attributes = state. extra ( ) . from_attributes . unwrap_or ( self . from_attributes ) ; 
132130
@@ -189,6 +187,7 @@ impl Validator for ModelFieldsValidator {
189187                        used_keys. insert ( lookup_path. first_key ( ) ) ; 
190188                    } 
191189                    if  let  Some ( msg)  = & field. deprecation_msg  { 
190+                         let  deprecation_warning_type = py. import_bound ( "builtins" ) ?. getattr ( "DeprecationWarning" ) ?; 
192191                        PyErr :: warn_bound ( py,  & deprecation_warning_type,  msg,  2 ) ?; 
193192                    } 
194193                    match  field. validator . validate ( py,  value. borrow_input ( ) ,  state)  { 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments