Skip to content
This repository has been archived by the owner on Feb 13, 2019. It is now read-only.

Commit

Permalink
Merge pull request #7 from theonion/channel-id-serialization
Browse files Browse the repository at this point in the history
Flatten channel ID data
  • Loading branch information
mparent61 committed Mar 2, 2016
2 parents b50c9a9 + dc53ddb commit a23e3cb
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
4 changes: 4 additions & 0 deletions videohub_client/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# videohub-client Change Log

## Version 0.2.1

- Fix: `VidehubVideo` serialization flattens channel ID

## Version 0.2.0

### Support for ES filtering of Videohub channel
Expand Down
2 changes: 1 addition & 1 deletion videohub_client/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.2.0"
__version__ = "0.2.1"
7 changes: 7 additions & 0 deletions videohub_client/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,10 @@ def save(self, **kwargs):
pass

return super(VideohubVideoSerializer, self).save(**kwargs)

def to_internal_value(self, data):
# Channel info passed as nested object, but we just store integer ID
channel = data.get('channel')
if channel and 'id' in channel:
data['channel_id'] = channel['id']
return super(VideohubVideoSerializer, self).to_internal_value(data)

0 comments on commit a23e3cb

Please sign in to comment.