blank=True fields are not required - fixes #514

This commit is contained in:
Yuri Prezument 2012-12-17 16:57:11 +02:00
parent 967f22e7d1
commit c68f7ca580

View File

@ -456,7 +456,7 @@ class ModelSerializer(Serializer):
kwargs['blank'] = model_field.blank kwargs['blank'] = model_field.blank
if model_field.null: if model_field.null or model_field.blank:
kwargs['required'] = False kwargs['required'] = False
if model_field.has_default(): if model_field.has_default():