Skip to content

Commit 67239b6

Browse files
bsekachevnmanovic
authored andcommitted
Trim possible attribute values like attribute values setup by a user (#1044)
1 parent c7d1c82 commit 67239b6

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

cvat-ui/src/components/labels-editor/label-form.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ class LabelForm extends React.PureComponent<Props, {}> {
6767
}
6868
}
6969

70+
attrValues = attrValues.map((value: string) => value.trim());
71+
7072
return {
7173
name: formValues.attrName[key],
7274
type: formValues.type[key],

cvat/apps/engine/serializers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class Meta:
2222
# pylint: disable=no-self-use
2323
def to_internal_value(self, data):
2424
attribute = data.copy()
25-
attribute['values'] = '\n'.join(data.get('values', []))
25+
attribute['values'] = '\n'.join(map(lambda x: x.strip(), data.get('values', [])))
2626
return attribute
2727

2828
def to_representation(self, instance):

0 commit comments

Comments
 (0)