dropbox chunked uploader fixed.
diff --git a/setup/doctype/backup_manager/backup_dropbox.py b/setup/doctype/backup_manager/backup_dropbox.py
index eb31a96..8cefebf 100644
--- a/setup/doctype/backup_manager/backup_dropbox.py
+++ b/setup/doctype/backup_manager/backup_dropbox.py
@@ -64,6 +64,7 @@
from dropbox import client, session, rest
from conf import dropbox_access_key, dropbox_secret_key
from webnotes.utils.backups import new_backup
+ found = False
if not webnotes.conn:
webnotes.connect()
@@ -81,15 +82,14 @@
upload_file_to_dropbox(filename, "database", dropbox_client)
response = dropbox_client.metadata("/files")
-
# upload files to files folder
- filename = os.path.join(get_base_path(), "public", "files")
- for filename in os.listdir(filename):
- found = False
+ path = os.path.join(get_base_path(), "public", "files")
+ for files in os.listdir(path):
+ filename = path + "/" + files
for file_metadata in response["contents"]:
- if filename==os.path.basename(file_metadata["path"]):
- if os.stat(filename).st_size==file_metadata["bytes"]:
- found=True
+ if os.path.basename(filename)==os.path.basename(file_metadata["path"]) and os.stat(filename).st_size==int(file_metadata["bytes"]):
+ found=True
+ break
if not found:
upload_file_to_dropbox(os.path.join(get_base_path(),"public", "files", filename), "files", dropbox_client)