Merge pull request #15 from anandpdoshi/master
db password logic change
This commit is contained in:
commit
73e53bb500
2 changed files with 5 additions and 3 deletions
|
|
@ -104,7 +104,7 @@ class HTTPRequest:
|
|||
else:
|
||||
db_name = getattr(webnotes.defs,'default_db_name','')
|
||||
|
||||
webnotes.conn = webnotes.db.Database(user = db_name,password = getattr(webnotes.defs,'db_password',''))
|
||||
webnotes.conn = webnotes.db.Database(user = db_name,password = getattr(webnotes.defs,'db_password', ''))
|
||||
webnotes.ac_name = ac_name
|
||||
|
||||
# =================================================================================
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ class Database:
|
|||
self.transaction_writes = 0
|
||||
self.testing_tables = []
|
||||
|
||||
self.password = self.get_db_password(ac_name, password)
|
||||
self.password = self.get_db_password(user, password)
|
||||
|
||||
self.connect()
|
||||
if self.user != 'root':
|
||||
|
|
@ -57,7 +57,9 @@ class Database:
|
|||
return ''
|
||||
|
||||
def get_db_login(self, ac_name):
|
||||
return getattr(defs,'db_name_map').get(ac_name, getattr(defs,'default_db_name'))
|
||||
if hasattr(defs, 'db_name_map'):
|
||||
return getattr(defs,'db_name_map').get(ac_name, getattr(defs,'default_db_name'))
|
||||
else: return ac_name
|
||||
|
||||
def connect(self):
|
||||
"""
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue