gateway patch

This commit is contained in:
Rushabh Mehta 2012-02-16 10:58:45 +01:00
parent 1b1179477b
commit 7c76f80966
2 changed files with 13 additions and 7 deletions

View File

@ -23,10 +23,11 @@ def execute():
txt = get_file_id(txt)
webnotes.conn.sql("""update `tab%s` set %s=%s where name=%s""" % \
(table[0], table[1], '%s', '%s'), (txt, item[0]), debug=1)
(table[0], table[1], '%s', '%s'), (txt, item[0]))
# control panel, client name
txt = webnotes.conn.get_value('Control Panel',None,'client_name')
if txt:
txt = get_file_id(txt)
webnotes.conn.set_value('Control Panel', None, 'client_name', txt.replace('index.cgi?cmd=get_file&fname=', 'files/'))
@ -34,6 +35,11 @@ def get_file_id(txt):
"""old file links may be from fileid or filename"""
import re
match = re.search('files/([^"\']*)', txt)
if not match:
print txt
return txt
fname = match.groups()[0]
if not fname.startswith('FileData'):
fid = webnotes.conn.sql("""select name from `tabFile Data`

View File

@ -7,7 +7,7 @@ def on_login(login_manager):
"""
called from login manager, before login
"""
if login_manager.user not in ('Guest', None, ''):
if login_manager.user not in ('Guest', None, '') and webnotes.conn.cur_db_name!='accounts' and webnotes.conn.get_value('Control Panel', 'Control Panel', 'account_id')!='s5u011':
try:
login_manager = login_as(login_manager)
update_account_details()
@ -32,7 +32,7 @@ def on_login_post_session(login_manager):
sid!=%s""", \
(webnotes.session['user'], webnotes.session['sid']), as_list=1)
if webnotes.session['user'] not in ('Guest'):
if webnotes.session['user'] not in ('Guest') and webnotes.conn.cur_db_name!='accounts':
# create feed
from webnotes.utils import nowtime
home.make_feed('Login', 'Profile', login_manager.user, login_manager.user,