use cstr instead of str in msgprint

This commit is contained in:
Rushabh Mehta 2011-08-11 12:30:42 +05:30
parent bd045b7384
commit a7241e27dd
3 changed files with 17 additions and 4 deletions

View file

@ -76,7 +76,18 @@
'fieldname': 'test_link',
'fieldtype': 'Link',
'idx': 2,
'label': 'Test Link'
'label': 'Test Link',
'options': 'Profile'
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'test_select',
'fieldtype': 'Select',
'idx': 2,
'label': 'Test Select',
'options': 'A\nB\nC'
},
# DocField

View file

@ -57,6 +57,8 @@ cookies = {}
auto_masters = {}
tenant_id = None
from webnotes.utils import cstr
#
# Custom Class (no traceback)
#
@ -90,13 +92,13 @@ def errprint(msg):
"""
Append to the :data:`debug log`
"""
debug_log.append(str(msg or ''))
debug_log.append(cstr(msg or ''))
def msgprint(msg, small=0, raise_exception=0):
"""
Append to the :data:`message_log`
"""
message_log.append((small and '__small:' or '')+str(msg or ''))
message_log.append((small and '__small:' or '')+cstr(msg or ''))
if raise_exception:
raise ValidationError

View file

@ -295,7 +295,7 @@ def cstr(s):
s = s.encode('utf-8', 'ignore')
except:
pass
return str(s)
return unicode(s)
def str_esc_quote(s):
"""