Skip to content

Commit

Permalink
fix: 修复表单组件的顺序改变的bug
Browse files Browse the repository at this point in the history
  • Loading branch information
zgqgit committed Jun 27, 2024
1 parent bd8fb56 commit d0f2cbd
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/backend/bisheng/database/models/variable_value.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,13 @@ def validate_value(v):
# dict_keys(['description', 'name', 'id', 'data'])
if not v:
return v

v = ','.join(set(v.split(',')))
return v
# 去重保持原来的顺序
v_list = v.split(',')
res = []
for one in v_list:
if one not in res:
res.append(one)
return ','.join(res)


class Variable(VariableBase, table=True):
Expand Down

0 comments on commit d0f2cbd

Please sign in to comment.