diff --git a/videohub_client/CHANGELOG.md b/videohub_client/CHANGELOG.md index 6bd8006..09969ee 100644 --- a/videohub_client/CHANGELOG.md +++ b/videohub_client/CHANGELOG.md @@ -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 diff --git a/videohub_client/__init__.py b/videohub_client/__init__.py index d3ec452..3ced358 100644 --- a/videohub_client/__init__.py +++ b/videohub_client/__init__.py @@ -1 +1 @@ -__version__ = "0.2.0" +__version__ = "0.2.1" diff --git a/videohub_client/serializers.py b/videohub_client/serializers.py index fd78623..50cb1a9 100644 --- a/videohub_client/serializers.py +++ b/videohub_client/serializers.py @@ -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)