diff --git a/smart_service/apis/master_api.py b/smart_service/apis/master_api.py index cceb46e..74f6508 100644 --- a/smart_service/apis/master_api.py +++ b/smart_service/apis/master_api.py @@ -485,7 +485,7 @@ def change_star_data(): select count(*) from tabProcedure_Details where content like '%**%'; ''', as_dict=1) print(count) - + updated_list = [] data = frappe.db.sql(''' select content_type,content,name,parent,replace(content,'**','abcxyz ') as new_content from tabProcedure_Details where content like '%**%'; ''', as_dict=1) @@ -504,4 +504,12 @@ def change_star_data(): FLAG = 0 frappe.db.sql( f'''update tabProcedure_Details set content = '{sts}' where name = '{v['name']}'; ''') - return data + v['new_content'] = sts + updated_list.append(v) + content_file = base_path + "/files/json_files/content_update.json" + with open(content_file, 'w') as outfile: + try: + outfile.write(json.dumps(updated_list)) + except: + pass + return content_file \ No newline at end of file