From 1f4580a27a6be78bf956bf8d614b2c21002d4026 Mon Sep 17 00:00:00 2001 From: Khanh Ngo Date: Sat, 20 Jun 2020 09:51:30 +0700 Subject: [PATCH] Log failed domain apply operation --- powerdnsadmin/routes/domain.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/powerdnsadmin/routes/domain.py b/powerdnsadmin/routes/domain.py index 9aaad31..7ccae8f 100644 --- a/powerdnsadmin/routes/domain.py +++ b/powerdnsadmin/routes/domain.py @@ -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(