minor fix to gdrive backups

This commit is contained in:
Usman Nasir
2020-06-14 10:34:46 +05:00
parent c16660a3d5
commit 7ca3f45584
2 changed files with 59 additions and 64 deletions

View File

@@ -210,6 +210,9 @@ class IncScheduler():
credentials = google.oauth2.credentials.Credentials(gDriveData['token'], gDriveData['refresh_token'],
gDriveData['token_uri'], gDriveData['client_id'],
gDriveData['client_secret'], gDriveData['scopes'])
items.auth = json.dumps(credentials)
items.save()
drive = build('drive', 'v3', credentials=credentials)
except BaseException as msg:
GDriveJobLogs(owner=items, status=backupSchedule.ERROR, message='Connection to this account failed. Delete and re-setup this account. Error: %s' % (str(msg))).save()