diff --git a/core/concepts/serializers.py b/core/concepts/serializers.py index 2b7828302..307532ddd 100644 --- a/core/concepts/serializers.py +++ b/core/concepts/serializers.py @@ -59,14 +59,13 @@ class Meta: 'uuid', 'external_id', 'type', 'locale', 'locale_preferred' ) - @staticmethod - def create(attrs, instance=None): # pylint: disable=arguments-differ + def create(self, validated_data, instance=None): # pylint: disable=arguments-differ concept_desc = instance if instance else LocalizedText() - concept_desc.name = attrs.get('name', concept_desc.name) - concept_desc.locale = attrs.get('locale', concept_desc.locale) - concept_desc.locale_preferred = attrs.get('locale_preferred', concept_desc.locale_preferred) - concept_desc.type = attrs.get('type', concept_desc.type) - concept_desc.external_id = attrs.get('external_id', concept_desc.external_id) + concept_desc.name = validated_data.get('name', concept_desc.name) + concept_desc.locale = validated_data.get('locale', concept_desc.locale) + concept_desc.locale_preferred = validated_data.get('locale_preferred', concept_desc.locale_preferred) + concept_desc.type = validated_data.get('type', concept_desc.type) + concept_desc.external_id = validated_data.get('external_id', concept_desc.external_id) concept_desc.save() return concept_desc diff --git a/core/concepts/views.py b/core/concepts/views.py index 17a413dd3..9a806e5a0 100644 --- a/core/concepts/views.py +++ b/core/concepts/views.py @@ -202,8 +202,7 @@ def get_object(self, queryset=None): class ConceptCollectionMembershipView(ConceptBaseView, ListWithHeadersMixin): - @staticmethod - def get_serializer_class(): + def get_serializer_class(self): from core.collections.serializers import CollectionVersionListSerializer return CollectionVersionListSerializer