added get_db_password in webnotes

This commit is contained in:
Rushabh Mehta 2011-08-30 11:38:22 +05:30
parent 74b1d09587
commit 3122251c3f
2 changed files with 11 additions and 1 deletions

View file

@ -197,3 +197,13 @@ def setup_logging():
if getattr(defs, 'log_file_name', None):
setup_logging()
def get_db_password(db_name):
from webnotes import defs
if hasattr(defs, 'get_db_password'):
return defs.get_db_password(db_name)
elif hasattr(defs, 'db_password'):
return defs.db_password
else:
return db_name

View file

@ -89,7 +89,7 @@ class Scheduler:
import webnotes, webnotes.defs, webnotes.db
try:
webnotes.conn = webnotes.db.Database(user=db_name, password=webnotes.defs.db_password)
webnotes.conn = webnotes.db.Database(user=db_name, password=webnotes.get_db_password(db_name))
webnotes.session = {'user':'Administrator'}
module = '.'.join(event.split('.')[:-1])