mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-01-23 15:54:16 +03:00
blank=True fields are not required - fixes #514
This commit is contained in:
parent
967f22e7d1
commit
c68f7ca580
|
@ -456,7 +456,7 @@ class ModelSerializer(Serializer):
|
|||
|
||||
kwargs['blank'] = model_field.blank
|
||||
|
||||
if model_field.null:
|
||||
if model_field.null or model_field.blank:
|
||||
kwargs['required'] = False
|
||||
|
||||
if model_field.has_default():
|
||||
|
|
Loading…
Reference in New Issue
Block a user