make sure values are unicode
This commit is contained in:
parent
93fcdc60ac
commit
7430d1b483
1 changed files with 2 additions and 0 deletions
|
@ -169,6 +169,8 @@ class Item(db.Model):
|
||||||
|
|
||||||
def add(k, v):
|
def add(k, v):
|
||||||
f = Find(item_id=self.id, key=k)
|
f = Find(item_id=self.id, key=k)
|
||||||
|
if isinstance(v, str):
|
||||||
|
v = v.decode('utf-8')
|
||||||
f.findvalue = unicodedata.normalize('NFKD', v).lower()
|
f.findvalue = unicodedata.normalize('NFKD', v).lower()
|
||||||
f.value = v
|
f.value = v
|
||||||
db.session.add(f)
|
db.session.add(f)
|
||||||
|
|
Loading…
Reference in a new issue