From 33e7ffb747be6763750121c5d89cb43d63d4419f Mon Sep 17 00:00:00 2001 From: jbe-dw <50663045+jbe-dw@users.noreply.github.com> Date: Thu, 7 Jan 2021 23:26:48 +0100 Subject: [PATCH] fix: Follow PDNS Api return format (#858) --- powerdnsadmin/routes/api.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/powerdnsadmin/routes/api.py b/powerdnsadmin/routes/api.py index 79ba125..2cf7fd6 100644 --- a/powerdnsadmin/routes/api.py +++ b/powerdnsadmin/routes/api.py @@ -903,7 +903,7 @@ def api_zone_forward(server_id, zone_id): status = resp.status_code if 200 <= status < 300: current_app.logger.debug("Request to powerdns API successful") - if request.method != 'GET' and request.method != 'DELETE': + if request.method == 'POST': data = request.get_json(force=True) for rrset_data in data['rrsets']: history = History(msg='{0} zone {1} record of {2}'.format( @@ -917,6 +917,11 @@ def api_zone_forward(server_id, zone_id): detail='', created_by=g.apikey.description) history.add() + elif request.method != 'GET': + history = History(msg='Updated zone {0}'.format(zone_id), + detail='', + created_by=g.apikey.description) + history.add() return resp.content, resp.status_code, resp.headers.items() @api_bp.route('/servers/', methods=['GET', 'PUT'])