[fix] backup manager
diff --git a/setup/doctype/backup_manager/backup_dropbox.py b/setup/doctype/backup_manager/backup_dropbox.py
index bbd33b5..1583f7e 100644
--- a/setup/doctype/backup_manager/backup_dropbox.py
+++ b/setup/doctype/backup_manager/backup_dropbox.py
@@ -16,8 +16,6 @@
from webnotes.utils import get_request_site_address, cstr
from webnotes import _
-from backup_manager import ignore_list
-
@webnotes.whitelist()
def get_dropbox_authorize_url():
sess = get_dropbox_session()
@@ -100,9 +98,7 @@
path = get_files_path()
for filename in os.listdir(path):
filename = cstr(filename)
- if filename in ignore_list:
- continue
-
+
found = False
filepath = os.path.join(path, filename)
for file_metadata in response["contents"]:
diff --git a/setup/doctype/backup_manager/backup_manager.js b/setup/doctype/backup_manager/backup_manager.js
index c011757..6fdb9e4 100644
--- a/setup/doctype/backup_manager/backup_manager.js
+++ b/setup/doctype/backup_manager/backup_manager.js
@@ -87,7 +87,7 @@
cur_frm.save();
},
- upload_backups_to_gdrive: function() {
- cur_frm.save();
- },
+ // upload_backups_to_gdrive: function() {
+ // cur_frm.save();
+ // },
});
\ No newline at end of file
diff --git a/setup/doctype/backup_manager/backup_manager.py b/setup/doctype/backup_manager/backup_manager.py
index 0a83dea..b094464 100644
--- a/setup/doctype/backup_manager/backup_manager.py
+++ b/setup/doctype/backup_manager/backup_manager.py
@@ -7,8 +7,6 @@
import webnotes
from webnotes import _
-ignore_list = []
-
class DocType:
def __init__(self, d, dl):
self.doc, self.doclist = d, dl
@@ -39,10 +37,6 @@
file_and_error = [" - ".join(f) for f in zip(did_not_upload, error_log)]
error_message = ("\n".join(file_and_error) + "\n" + webnotes.getTraceback())
webnotes.errprint(error_message)
-
- if not webnotes.conn:
- webnotes.connect()
-
send_email(False, "Dropbox", error_message)
#backup to gdrive
@@ -62,6 +56,7 @@
send_email(False, "Google Drive", error_message)
def send_email(success, service_name, error_status=None):
+ from webnotes.utils.email_lib import sendmail
if success:
subject = "Backup Upload Successful"
message ="""<h3>Backup Uploaded Successfully</h3><p>Hi there, this is just to inform you
@@ -76,7 +71,8 @@
<p>Please contact your system manager for more information.</p>
""" % (service_name, error_status)
- # email system managers
- from webnotes.utils.email_lib import sendmail
- sendmail(webnotes.conn.get_value("Backup Manager", None, "send_notifications_to").split(","),
- subject=subject, msg=message)
+ if not webnotes.conn:
+ webnotes.connect()
+
+ recipients = webnotes.conn.get_value("Backup Manager", None, "send_notifications_to").split(",")
+ sendmail(recipients, subject=subject, msg=message)