mirror of
				https://github.com/encode/django-rest-framework.git
				synced 2025-11-04 09:57:55 +03:00 
			
		
		
		
	Merge pull request #3012 from jannon/fix-allow-blank-mapping
only include 'allow_blank' on supported fields
This commit is contained in:
		
						commit
						8d4c96ecd6
					
				| 
						 | 
					@ -102,7 +102,8 @@ def get_field_kwargs(field_name, model_field):
 | 
				
			||||||
    if model_field.null and not isinstance(model_field, models.NullBooleanField):
 | 
					    if model_field.null and not isinstance(model_field, models.NullBooleanField):
 | 
				
			||||||
        kwargs['allow_null'] = True
 | 
					        kwargs['allow_null'] = True
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if model_field.blank:
 | 
					    if model_field.blank and (isinstance(model_field, models.CharField) or
 | 
				
			||||||
 | 
					                              isinstance(model_field, models.TextField)):
 | 
				
			||||||
        kwargs['allow_blank'] = True
 | 
					        kwargs['allow_blank'] = True
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if model_field.flatchoices:
 | 
					    if model_field.flatchoices:
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user