Merge pull request #761 from ngoduykhanh/record_rollback

Fix #752 - Rollback the removed record if apply operation failed
This commit is contained in:
Khanh Ngo
2020-10-11 13:01:26 +02:00
committed by GitHub
5 changed files with 57 additions and 36 deletions

View File

@ -439,6 +439,15 @@ def record_apply(domain_name):
history.add()
return make_response(jsonify(result), 200)
else:
history = History(
msg='Failed to apply record changes to domain {0}'.format(domain_name),
detail=str(
json.dumps({
"domain": domain_name,
"msg": result['msg'],
})),
created_by=current_user.username)
history.add()
return make_response(jsonify(result), 400)
except Exception as e:
current_app.logger.error(