Update value.py

value type 是 int 或 float 时 value 值等于 0 是会删除 的 BUG
This commit is contained in:
lovvvve 2021-01-28 16:57:20 +08:00 committed by GitHub
parent 8a5dadcaa4
commit 3c6cc7f91b
1 changed files with 1 additions and 1 deletions

View File

@ -161,7 +161,7 @@ class AttributeValueManager(object):
self._write_change(ci.id, attr.id, OperateType.ADD, None, value)
else:
if existed_value != value:
if value == 0 and not value and attr.value_type != ValueTypeEnum.TEXT:
if value != 0 and not value and attr.value_type != ValueTypeEnum.TEXT:
existed_attr.delete()
else:
existed_attr.update(value=value)