Unset compression ratio if it is an empty string in Backup module. Fixes #2582

This commit is contained in:
Surinder Kumar 2017-08-17 16:35:42 +05:30 committed by Akshay Joshi
parent bff48e0b2d
commit c7686dee05
2 changed files with 10 additions and 0 deletions

View File

@ -360,6 +360,10 @@ def create_backup_objects_job(sid):
else:
data = json.loads(request.data, encoding='utf-8')
# Remove ratio from data in case of empty string
if 'ratio' in data and data['ratio'] == '':
data.pop("ratio")
try:
backup_file = filename_with_file_manager_path(data['file'])
except Exception as e:

View File

@ -773,6 +773,12 @@ TODO LIST FOR BACKUP:
);
}
// Remove ratio attribute from model if it has empty string.
// The valid value can be between 0 to 9.
if (_.isEmpty(this.view.model.get('ratio'))) {
this.view.model.unset('ratio');
}
var self = this,
baseUrl = url_for('backup.create_object_job', {'sid': treeInfo.server._id}),
args = this.view.model.toJSON();