[minor] fixes to crm patch

This commit is contained in:
Rushabh Mehta 2013-10-03 18:12:35 +05:30
parent 846e216cd7
commit 5ee2f74a7e
3 changed files with 20 additions and 3 deletions

View file

@ -2,7 +2,7 @@
{
"creation": "2013-01-17 11:36:45",
"docstatus": 0,
"modified": "2013-07-05 14:48:05",
"modified": "2013-10-03 17:39:09",
"modified_by": "Administrator",
"owner": "Administrator"
},
@ -26,11 +26,25 @@
"parenttype": "DocType",
"permlevel": 0
},
{
"doctype": "DocPerm",
"name": "__common__",
"parent": "Patch Log",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
"read": 1,
"report": 1,
"role": "Administrator"
},
{
"doctype": "DocType",
"name": "Patch Log"
},
{
"doctype": "DocField"
},
{
"doctype": "DocPerm"
}
]

View file

@ -14,6 +14,8 @@ from __future__ import unicode_literals
"""
import webnotes
class PatchError(Exception): pass
def run_all(patch_list=None):
"""run all pending patches"""
if webnotes.conn.table_exists("__PatchLog"):
@ -24,7 +26,8 @@ def run_all(patch_list=None):
for patch in (patch_list or patches.patch_list.patch_list):
if patch not in executed:
if not run_single(patchmodule = patch):
return log(patch + ': failed: STOPPED')
log(patch + ': failed: STOPPED')
raise PatchError(patch)
def reload_doc(args):
import webnotes.modules

2
wnf.py
View file

@ -231,7 +231,7 @@ def update(remote=None, branch=None, site=None):
latest(site=site)
@cmd
def latest(site=None, verbose=False):
def latest(site=None, verbose=True):
import webnotes.modules.patch_handler
import webnotes.model.sync