From 4bfaaf33aae9f84921befa296877cc4fc6f4584f Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Mon, 4 Nov 2013 15:31:00 +0530 Subject: [PATCH] [minor] fix in patch --- patches/october_2013/p07_rename_for_territory.py | 4 +++- .../p08_cleanup_after_item_price_module_change.py | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/patches/october_2013/p07_rename_for_territory.py b/patches/october_2013/p07_rename_for_territory.py index c4b674574c..c7734837a0 100644 --- a/patches/october_2013/p07_rename_for_territory.py +++ b/patches/october_2013/p07_rename_for_territory.py @@ -5,6 +5,8 @@ from __future__ import unicode_literals import webnotes, os def execute(): + import shutil + webnotes.reload_doc("core", "doctype", "doctype") tables = webnotes.conn.sql_list("show tables") @@ -16,7 +18,7 @@ def execute(): path = os.path.join(get_base_path(), "app", "setup", "doctype", "for_territory") if os.path.exists(path): - os.system("rm -rf {path}".format(path=path)) + shutil.rmtree(path) if webnotes.conn.exists("DocType", "For Territory"): webnotes.delete_doc("DocType", "For Territory") \ No newline at end of file diff --git a/patches/october_2013/p08_cleanup_after_item_price_module_change.py b/patches/october_2013/p08_cleanup_after_item_price_module_change.py index 4169d96b3e..cbc1c86c8a 100644 --- a/patches/october_2013/p08_cleanup_after_item_price_module_change.py +++ b/patches/october_2013/p08_cleanup_after_item_price_module_change.py @@ -5,9 +5,10 @@ from __future__ import unicode_literals import webnotes, os def execute(): + import shutil from webnotes.utils import get_base_path for dt in ("item_price", "price_list"): path = os.path.join(get_base_path(), "app", "setup", "doctype", dt) if os.path.exists(path): - os.system("rm -rf {path}".format(path=path)) \ No newline at end of file + shutil.rmtree(path) \ No newline at end of file