Commit 4e035184 by Tom Christie

required=False for nullable relationships

parent 7394dcec
...@@ -215,7 +215,7 @@ def get_relation_kwargs(field_name, relation_info): ...@@ -215,7 +215,7 @@ def get_relation_kwargs(field_name, relation_info):
# If this field is read-only, then return early. # If this field is read-only, then return early.
# No further keyword arguments are valid. # No further keyword arguments are valid.
return kwargs return kwargs
if model_field.has_default(): if model_field.has_default() or model_field.null:
kwargs['required'] = False kwargs['required'] = False
if model_field.null: if model_field.null:
kwargs['allow_null'] = True kwargs['allow_null'] = True
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment