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'])