Browse Source

remove extra spaces in file path

master
venkataakhil 1 year ago
parent
commit
064f1298a5
  1. 2
      smart_service/apis/master_api.py

2
smart_service/apis/master_api.py

@ -461,6 +461,7 @@ def file_not_exists():
def remove_extra_spaces_in_file_path():
frappe.db.sql(f''' set sql_safe_updates=0; ''')
import re
file_path_not_exists = base_path + "/files/json_files/1.json"
with open(file_path_not_exists, 'r') as outfile:
@ -471,6 +472,7 @@ def remove_extra_spaces_in_file_path():
res_str = re.sub("/files/ ", "/files/", d['file'])
# res_str = re.sub("/files/ ", "/files/", res_str)
print(res_str)
frappe.db.sql(f'''
update tabProcedure_Details set file = '{res_str}' where name = '{d['name']}';
''')

Loading…
Cancel
Save