Browse Source

Mar 15 [UPDT] : Updated 'auto_database_backup'

pull/278/merge
AjmalCybro 1 year ago
parent
commit
1f6b6ab42b
  1. 2
      auto_database_backup/__manifest__.py
  2. 10
      auto_database_backup/doc/RELEASE_NOTES.md
  3. 19
      auto_database_backup/models/db_backup_configure.py

2
auto_database_backup/__manifest__.py

@ -22,7 +22,7 @@
{
'name': "Automatic Database Backup To Local Server, Remote Server,"
"Google Drive, Dropbox, Onedrive, Nextcloud and Amazon S3",
'version': '16.0.3.0.2',
'version': '16.0.4.0.1',
'category': 'Extra Tools',
'summary': 'Generate automatic backup of databases and store to local, '
'google drive, dropbox, nextcloud, amazon S3, onedrive or '

10
auto_database_backup/doc/RELEASE_NOTES.md

@ -20,4 +20,12 @@
#### Version 16.0.3.0.2
#### UPDT
- Updated the database name check function which got access denied when list_db=False.
- Updated the database name check function which got access denied when list_db=False.
## Module <auto_database_backup>
#### 16.02.2024
#### Version 16.0.4.0.1
#### UPDT
- Fixed internal server error in Onedrive and Google Drive integration.

19
auto_database_backup/models/db_backup_configure.py

@ -438,6 +438,9 @@ class DbBackupConfigure(models.Model):
res = requests.post(
"https://login.microsoftonline.com/common/oauth2/v2.0/token",
data=data, headers=headers)
if res.status_code != 200:
raise ValidationError(
"Bad microsoft onedrive request..!")
res.raise_for_status()
response = res.content and res.json() or {}
if response:
@ -525,12 +528,16 @@ class DbBackupConfigure(models.Model):
def set_dropbox_refresh_token(self, auth_code):
"""Generate and set the dropbox refresh token from authorization code"""
dbx_auth = dropbox.oauth.DropboxOAuth2FlowNoRedirect(
self.dropbox_client_key,
self.dropbox_client_secret,
token_access_type='offline')
outh_result = dbx_auth.finish(auth_code)
self.dropbox_refresh_token = outh_result.refresh_token
try:
dbx_auth = dropbox.oauth.DropboxOAuth2FlowNoRedirect(
self.dropbox_client_key,
self.dropbox_client_secret,
token_access_type='offline')
outh_result = dbx_auth.finish(auth_code)
self.dropbox_refresh_token = outh_result.refresh_token
except Exception:
raise ValidationError(
'Please Enter Valid Authentication Code')
@api.constrains('db_name')
def _check_db_credentials(self):

Loading…
Cancel
Save