We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dfd334b commit 1633478Copy full SHA for 1633478
rest_framework_json_api/utils.py
@@ -169,8 +169,9 @@ def extract_attributes(fields, resource):
169
# Skip fields with relations
170
if isinstance(field, (RelatedField, BaseSerializer, ManyRelatedField)):
171
continue
172
-
173
- data.update({field_name: encoding.force_text(resource[field_name])})
+ data.update({
+ field_name: (encoding.force_text(resource[field_name]) if resource[field_name] is not None else None)
174
+ })
175
176
return format_keys(data)
177
0 commit comments