diff --git a/apps/news/serializers.py b/apps/news/serializers.py index e3ffd01f..9bff32af 100644 --- a/apps/news/serializers.py +++ b/apps/news/serializers.py @@ -214,12 +214,12 @@ class NewsBackOfficeBaseSerializer(NewsBaseSerializer): 'active': True, 'inactive': False, } - attrs['slugs'] = {obj['locale']: obj['slug'] for obj in descriptions} - attrs['title'] = {obj['locale']: obj['title'] for obj in descriptions} + attrs['slugs'] = {obj['locale']: obj['slug'] for obj in descriptions if 'slug' in obj} + attrs['title'] = {obj['locale']: obj['title'] for obj in descriptions if 'title' in obj} attrs['locale_to_description_is_active'] = { obj['locale']: status_to_bool[obj['status']] for obj in descriptions } - attrs['description'] = {obj['locale']: obj['text'] for obj in descriptions} + attrs['description'] = {obj['locale']: obj['text'] for obj in descriptions if 'text' in obj} return attrs def create(self, validated_data):