Browse Source

File ext validation

master
venkataakhil 2 years ago
parent
commit
f388404c64
  1. 6
      smart_service/apis/master_api.py

6
smart_service/apis/master_api.py

@ -393,7 +393,7 @@ def change_file_dir():
select name,file from tabProcedure_Details where content_type = 'File' and file = '/files/Driver Seat Back Rest Foam.jpg' ;''', as_dict=1)
for d in data:
frappe.log_error("File data :", str(file_name))
frappe.log_error("File data :", str(d))
path = os.path.join(base_url, d['file'])
isExist = os.path.exists(path)
@ -418,5 +418,7 @@ def change_file_dir():
# update tabProcedure_Details set file = '{d[:-3]+ ext}' where content_type = 'File' and name = '{d['name']}';
# ''')
# frappe.db.commit()
if data:
return data
else:
return "Done"

Loading…
Cancel
Save