Minor changes in patch_handler
This commit is contained in:
parent
f93208d04e
commit
f72c85dc6d
1 changed files with 3 additions and 1 deletions
|
|
@ -33,7 +33,7 @@ class PatchHandler:
|
|||
self.verbose = kwargs.get('verbose')
|
||||
try:
|
||||
self.db_name = kwargs.get('db_name')
|
||||
webnotes.conn = None
|
||||
if webnotes.conn: webnotes.conn.close()
|
||||
webnotes.conn = Database(user=self.db_name)
|
||||
webnotes.conn.use(self.db_name)
|
||||
if not (webnotes.session and webnotes.session['user']):
|
||||
|
|
@ -177,9 +177,11 @@ class PatchHandler:
|
|||
patch = str(patch_module) + "." + str(patch_file)
|
||||
|
||||
if log_type == 'success':
|
||||
webnotes.conn.begin()
|
||||
webnotes.conn.sql("""\
|
||||
INSERT INTO `__PatchLog`
|
||||
VALUES (%s, now())""", patch)
|
||||
webnotes.conn.commit()
|
||||
if self.verbose: print 'Patch: %s applied successfully on %s' % (patch, str(self.db_name))
|
||||
|
||||
elif log_type == 'error' or log_type == 'info':
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue