utf issue in recent
This commit is contained in:
parent
cff82cd226
commit
0698438c74
1 changed files with 4 additions and 2 deletions
|
|
@ -176,12 +176,14 @@ class Profile:
|
|||
Update the user's `Recent` list with the given `dt` and `dn`
|
||||
"""
|
||||
conn = webnotes.conn
|
||||
from webnotes.utils import cstr
|
||||
|
||||
# get list of child tables, so we know what not to add in the recent list
|
||||
child_tables = [t[0] for t in conn.sql('select name from tabDocType where istable = 1')]
|
||||
|
||||
if not (dt in ['Print Format', 'Start Page', 'Event', 'ToDo Item', 'Search Criteria']) and not webnotes.is_testing and not (dt in child_tables):
|
||||
r = webnotes.conn.sql("select recent_documents from tabProfile where name=%s", self.name)[0][0] or ''
|
||||
new_str = dt+'~~~'+dn + '\n'
|
||||
r = cstr(webnotes.conn.sql("select recent_documents from tabProfile where name=%s", self.name)[0][0] or '')
|
||||
new_str = cstr(dt)+'~~~'+cstr(dn) + '\n'
|
||||
if new_str in r:
|
||||
r = r.replace(new_str, '')
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue