diff --git a/auto_database_backup/__manifest__.py b/auto_database_backup/__manifest__.py index 078a19faf..a4d7611b9 100644 --- a/auto_database_backup/__manifest__.py +++ b/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 ' diff --git a/auto_database_backup/doc/RELEASE_NOTES.md b/auto_database_backup/doc/RELEASE_NOTES.md index a5890b574..53105e805 100644 --- a/auto_database_backup/doc/RELEASE_NOTES.md +++ b/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. \ No newline at end of file +- Updated the database name check function which got access denied when list_db=False. + +## Module + +#### 16.02.2024 +#### Version 16.0.4.0.1 +#### UPDT + +- Fixed internal server error in Onedrive and Google Drive integration. \ No newline at end of file diff --git a/auto_database_backup/models/db_backup_configure.py b/auto_database_backup/models/db_backup_configure.py index 58b82567f..1337a23ae 100644 --- a/auto_database_backup/models/db_backup_configure.py +++ b/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):