diff --git a/apps/common/serializers/mixin.py b/apps/common/serializers/mixin.py index 1a749f6d3..d51849f07 100644 --- a/apps/common/serializers/mixin.py +++ b/apps/common/serializers/mixin.py @@ -394,7 +394,7 @@ class CommonBulkModelSerializer(CommonBulkSerializerMixin, serializers.ModelSeri class ResourceLabelsMixin(serializers.Serializer): - labels = LabelRelatedField(many=True, label=_('Labels'), ) + labels = LabelRelatedField(many=True, label=_('Labels'), required=False, allow_null=True) def update(self, instance, validated_data): labels = validated_data.pop('labels', None) diff --git a/apps/labels/serializers.py b/apps/labels/serializers.py index 476b3c06f..157afc92e 100644 --- a/apps/labels/serializers.py +++ b/apps/labels/serializers.py @@ -13,7 +13,7 @@ __all__ = ['LabelSerializer', 'LabeledResourceSerializer', 'ContentTypeResourceS class LabelSerializer(BulkOrgResourceModelSerializer): class Meta: model = Label - fields = ['id', 'name', 'value', 'res_count', 'date_created', 'date_updated'] + fields = ['id', 'name', 'value', 'res_count', 'comment', 'date_created', 'date_updated'] read_only_fields = ('date_created', 'date_updated', 'res_count') extra_kwargs = { 'res_count': {'label': _('Resource count')},