[minor] [fix] dropbox

This commit is contained in:
Anand Doshi 2013-11-18 13:49:41 +05:30
parent 0809a95a70
commit 1d55be86b2
2 changed files with 9 additions and 2 deletions

View File

@ -64,6 +64,9 @@ def dropbox_callback(oauth_token=None, not_approved=False):
webnotes.local.message_title = "Dropbox Approval"
webnotes.local.message = "<h3>%s</h3><p>Please close this window.</p>" % message
if allowed:
webnotes.local.message_success = True
webnotes.conn.commit()
webnotes.response['type'] = 'page'
webnotes.response['page_name'] = 'message.html'
@ -109,9 +112,9 @@ def backup_to_dropbox():
if not found:
try:
upload_file_to_dropbox(filepath, "/files", dropbox_client)
except Exception, e:
except Exception:
did_not_upload.append(filename)
error_log.append(cstr(e))
error_log.append(webnotes.getTraceback())
webnotes.connect()
return did_not_upload, list(set(error_log))

View File

@ -39,6 +39,10 @@ def take_backups_dropbox():
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