From 1e3b6703d64b3a430632a3017d206d050fb89890 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 17 Aug 2011 12:21:05 +0530 Subject: [PATCH 1/3] if file does not exist, page will load from database --- cgi-bin/webnotes/widgets/page.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cgi-bin/webnotes/widgets/page.py b/cgi-bin/webnotes/widgets/page.py index 0cad0b72d6..de31fb9fd7 100644 --- a/cgi-bin/webnotes/widgets/page.py +++ b/cgi-bin/webnotes/widgets/page.py @@ -19,7 +19,7 @@ class Page: Loads page info from files in module """ # load js - doc.fields['__script'] = module.get_doc_file('page',doc.name,'.js').read() + doc.fields['__script'] = module.get_doc_file('page',doc.name,'.js').read() or doc.script doc.script = None # load css From 56aad3c6e61d025ecd2a63ce6e08e506b991d18c Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Thu, 18 Aug 2011 17:40:54 +0530 Subject: [PATCH 2/3] changed db password logic --- cgi-bin/webnotes/auth.py | 2 +- cgi-bin/webnotes/db.py | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/cgi-bin/webnotes/auth.py b/cgi-bin/webnotes/auth.py index d15309020b..d2b35075f9 100644 --- a/cgi-bin/webnotes/auth.py +++ b/cgi-bin/webnotes/auth.py @@ -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', None)) webnotes.ac_name = ac_name # ================================================================================= diff --git a/cgi-bin/webnotes/db.py b/cgi-bin/webnotes/db.py index 8d175e317e..45837a2051 100644 --- a/cgi-bin/webnotes/db.py +++ b/cgi-bin/webnotes/db.py @@ -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): """ From 42d17ae066ec4d37ae89ecfd0543642d55fa311a Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Fri, 19 Aug 2011 07:52:06 +0530 Subject: [PATCH 3/3] Edited cgi-bin/webnotes/auth.py via GitHub --- cgi-bin/webnotes/auth.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cgi-bin/webnotes/auth.py b/cgi-bin/webnotes/auth.py index d2b35075f9..a3f04a1a1b 100644 --- a/cgi-bin/webnotes/auth.py +++ b/cgi-bin/webnotes/auth.py @@ -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', None)) + webnotes.conn = webnotes.db.Database(user = db_name,password = getattr(webnotes.defs,'db_password', '')) webnotes.ac_name = ac_name # =================================================================================