mirror of
https://github.com/cwinfo/powerdns-admin.git
synced 2024-11-08 14:40:27 +00:00
fix: Follow PDNS Api return format (#858)
This commit is contained in:
parent
2c18e5c88f
commit
33e7ffb747
@ -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/<path:subpath>', methods=['GET', 'PUT'])
|
||||
|
Loading…
Reference in New Issue
Block a user