Skip to content

Commit

Permalink
Fixes #230. Keep write only fields from having an attribute key
Browse files Browse the repository at this point in the history
  • Loading branch information
jerel committed Apr 29, 2016
1 parent 2bd4aea commit c3e2d39
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions rest_framework_json_api/renderers.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ def extract_attributes(fields, resource):
# ID is always provided in the root of JSON API so remove it from attributes
if field_name == 'id':
continue
# don't output a key for write only fields
if fields[field_name].write_only:
continue
# Skip fields with relations
if isinstance(field, (relations.RelatedField, relations.ManyRelatedField, BaseSerializer)):
continue
Expand Down

0 comments on commit c3e2d39

Please sign in to comment.