fixed issue 1132, unicode in IS_IN_DB validator
This commit is contained in:
1 parent
f02fe585c8
commit
d16ad52a56
2 files changed
+4
-1
No files matched your search
@@ -1 +1 @@
|
|||||||
Version 2.2.1 (2012-11-01 21:01:40) stable
|
Version 2.2.1 (2012-11-01 21:07:42) stable
|
||||||
@@ -575,6 +575,9 @@ class IS_NOT_IN_DB(Validator):
|
|||||||
self.record_id = id
|
self.record_id = id
|
||||||
|
|
||||||
def __call__(self, value):
|
def __call__(self, value):
|
||||||
|
if isinstance(value,unicode):
|
||||||
|
value = value.encode('utf8')
|
||||||
|
else:
|
||||||
value = str(value)
|
value = str(value)
|
||||||
if not value.strip():
|
if not value.strip():
|
||||||
return (value, translate(self.error_message))
|
return (value, translate(self.error_message))
|
||||||
|
|||||||
Reference in new issue
Block a user