Browse Source

Change file ext

master
venkataakhil 2 years ago
parent
commit
74eca8f094
  1. BIN
      smart_service/__pycache__/__init__.cpython-38.pyc
  2. BIN
      smart_service/__pycache__/hooks.cpython-38.pyc
  3. BIN
      smart_service/apis/__pycache__/app_user_login.cpython-38.pyc
  4. BIN
      smart_service/apis/__pycache__/update_validation.cpython-38.pyc
  5. 35
      smart_service/apis/master_api.py
  6. BIN
      smart_service/transactions/__pycache__/__init__.cpython-38.pyc
  7. BIN
      smart_service/transactions/doctype/__pycache__/__init__.cpython-38.pyc
  8. BIN
      smart_service/transactions/doctype/fish/__pycache__/__init__.cpython-38.pyc
  9. BIN
      smart_service/transactions/doctype/fish/__pycache__/fish.cpython-38.pyc
  10. BIN
      smart_service/transactions/doctype/procedure/__pycache__/__init__.cpython-38.pyc
  11. BIN
      smart_service/transactions/doctype/procedure/__pycache__/procedure.cpython-38.pyc
  12. BIN
      smart_service/transactions/doctype/procedure_details/__pycache__/__init__.cpython-38.pyc
  13. BIN
      smart_service/transactions/doctype/procedure_details/__pycache__/procedure_details.cpython-38.pyc
  14. 0
      smart_service/www/__init__.py
  15. BIN
      smart_service/www/__pycache__/login.cpython-38.pyc

BIN
smart_service/__pycache__/__init__.cpython-38.pyc

Binary file not shown.

BIN
smart_service/__pycache__/hooks.cpython-38.pyc

Binary file not shown.

BIN
smart_service/apis/__pycache__/app_user_login.cpython-38.pyc

Binary file not shown.

BIN
smart_service/apis/__pycache__/update_validation.cpython-38.pyc

Binary file not shown.

35
smart_service/apis/master_api.py

@ -373,7 +373,7 @@ def append_size_file():
except Exception as e: except Exception as e:
frappe.log_error("FIle size ", str(e)) frappe.log_error("FIle size ", str(e))
return e return e
def asset_to_files_path(): def asset_to_files_path():
try: try:
@ -387,5 +387,36 @@ def asset_to_files_path():
except: except:
return False return False
def change_file_dir(): def change_file_dir():
pass data = frappe.db.sql('''
select name,file from tabProcedure_Details where content_type = 'File';''', as_dict=1)
for d in data:
frappe.log_error("Inside Loop", str(d))
path = os.path.join(base_url, d['file'])
isExist = os.path.exists(path)
if not isExist:
frappe.log_error("Invalid file:", str(path))
ext = path[-3:]
path = path[:-3]
if ext == 'png':
ext == 'jpg'
if ext == 'jpg':
ext == 'png'
path = path[:-3] + ext
if os.path.exists(path):
file_name = d[:-3]+ ext
frappe.log_error("Valid file validation:", str(path))
frappe.log_error("New file :", str(file_name))
frappe.db.sql(f'''
update tabProcedure_Details set file = '{d[:-3]+ ext}' where content_type = 'File' and name = '{d['name']}';
''')
# frappe.db.commit()
return data

BIN
smart_service/transactions/__pycache__/__init__.cpython-38.pyc

Binary file not shown.

BIN
smart_service/transactions/doctype/__pycache__/__init__.cpython-38.pyc

Binary file not shown.

BIN
smart_service/transactions/doctype/fish/__pycache__/__init__.cpython-38.pyc

Binary file not shown.

BIN
smart_service/transactions/doctype/fish/__pycache__/fish.cpython-38.pyc

Binary file not shown.

BIN
smart_service/transactions/doctype/procedure/__pycache__/__init__.cpython-38.pyc

Binary file not shown.

BIN
smart_service/transactions/doctype/procedure/__pycache__/procedure.cpython-38.pyc

Binary file not shown.

BIN
smart_service/transactions/doctype/procedure_details/__pycache__/__init__.cpython-38.pyc

Binary file not shown.

BIN
smart_service/transactions/doctype/procedure_details/__pycache__/procedure_details.cpython-38.pyc

Binary file not shown.

0
smart_service/www/__init__.py

BIN
smart_service/www/__pycache__/login.cpython-38.pyc

Binary file not shown.
Loading…
Cancel
Save