diff --git a/cvat-ui/src/components/labels-editor/label-form.tsx b/cvat-ui/src/components/labels-editor/label-form.tsx index 6ad63efdfd3..b23f84f659f 100644 --- a/cvat-ui/src/components/labels-editor/label-form.tsx +++ b/cvat-ui/src/components/labels-editor/label-form.tsx @@ -67,6 +67,8 @@ class LabelForm extends React.PureComponent { } } + attrValues = attrValues.map((value: string) => value.trim()); + return { name: formValues.attrName[key], type: formValues.type[key], diff --git a/cvat/apps/engine/serializers.py b/cvat/apps/engine/serializers.py index 08903d7efc0..285ba7f83d5 100644 --- a/cvat/apps/engine/serializers.py +++ b/cvat/apps/engine/serializers.py @@ -22,7 +22,7 @@ class Meta: # pylint: disable=no-self-use def to_internal_value(self, data): attribute = data.copy() - attribute['values'] = '\n'.join(data.get('values', [])) + attribute['values'] = '\n'.join(map(lambda x: x.strip(), data.get('values', []))) return attribute def to_representation(self, instance):