mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-05 21:29:11 +00:00
[files] [cleanup/redesign] removed the old file_list structure and also added file listing in setup
This commit is contained in:
@@ -4,8 +4,9 @@ def execute():
|
|||||||
files_path = webnotes.utils.get_path("public", "files")
|
files_path = webnotes.utils.get_path("public", "files")
|
||||||
for f in webnotes.conn.sql("""select name, file_name from
|
for f in webnotes.conn.sql("""select name, file_name from
|
||||||
`tabFile Data`""", as_dict=True):
|
`tabFile Data`""", as_dict=True):
|
||||||
filepath = os.path.join(files_path, f.file_name)
|
if f.file_name:
|
||||||
if os.path.exists(filepath):
|
filepath = os.path.join(files_path, f.file_name)
|
||||||
webnotes.conn.set_value("File Data", f.name, "file_size", os.stat(filepath).st_size)
|
if os.path.exists(filepath):
|
||||||
|
webnotes.conn.set_value("File Data", f.name, "file_size", os.stat(filepath).st_size)
|
||||||
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user