Esempio n. 1
0
def run(log_exception=1):
	import webnotes
	from patches import patch
	from webnotes.utils import cint
	
	if webnotes.conn.cur_db_name=='accounts':
		# no patches on accounts
		return
	
	next_patch = cint(webnotes.conn.get_global('next_patch'))
	
	if next_patch <= patch.last_patch:
		for i in range(next_patch, patch.last_patch+1):
			webnotes.conn.begin()
			if log_exception:
				try:
					patch.execute(i)
				except Exception, e:
					write_log()	
					return
			else:
				patch.execute(i)

			webnotes.conn.set_global('next_patch', str(i+1))
			webnotes.conn.commit()
Esempio n. 2
0
def run():
	import webnotes
	from patches import patch
	from webnotes.utils import cint
	
	next_patch = cint(webnotes.conn.get_global('next_patch'))
	
	if next_patch <= patch.last_patch:
		for i in range(next_patch, patch.last_patch+1):
			webnotes.conn.begin()
			try:
				patch.execute(i)	
			except Exception, e:
				write_log()	
				return

			webnotes.conn.set_global('next_patch', str(i+1))
			webnotes.conn.commit()