Browse Source

Base url

master
venkataakhil 1 year ago
parent
commit
35000f9cec
  1. 7
      smart_service/apis/master_api.py

7
smart_service/apis/master_api.py

@ -415,6 +415,8 @@ def change_file_dir():
# frappe.log_error("New file :", str(file_name)) # frappe.log_error("New file :", str(file_name))
base_url = os.path.expanduser(
"~") + "/frappe-bench/sites/" + site_name + "/public/files"
for d in data: for d in data:
frappe.log_error("File data :", str(d)) frappe.log_error("File data :", str(d))
@ -434,11 +436,12 @@ def change_file_dir():
new_full_path = path + extension new_full_path = path + extension
frappe.log_error("New path:", str(new_full_path)) frappe.log_error("New path:", str(new_full_path))
if os.path.exists(os.path.join(base_url,new_full_path)): new_file_dir = os.path.join(base_url,new_full_path)
if os.path.exists(new_file_dir):
frappe.log_error("final", str('ext changed File exists in local:'+ str(os.path.join(base_url,new_full_path)))) frappe.log_error("final", str('ext changed File exists in local:'+ str(os.path.join(base_url,new_full_path))))
else: else:
frappe.log_error("final", str('File Not exists' + str(os.path.join(base_url,new_full_path)))) frappe.log_error("final", str('File Not exists: ' + str(os.path.join(base_url,new_full_path))))
# frappe.db.sql(f''' # frappe.db.sql(f'''
# update tabProcedure_Details set file = '{new_full_path}' where content_type = 'File' and name = '{d['name']}'; # update tabProcedure_Details set file = '{new_full_path}' where content_type = 'File' and name = '{d['name']}';
# ''') # ''')

Loading…
Cancel
Save