diff --git a/app/models.py b/app/models.py index 0905e73..88eb263 100644 --- a/app/models.py +++ b/app/models.py @@ -803,13 +803,15 @@ class Record(object): records = [] for r in deleted_records: record = { - "name": r['name'], + "name": r['name'] + '.' if NEW_SCHEMA else r['name'], "type": r['type'], "changetype": "DELETE", "records": [ ] } records.append(record) + + print records postdata_for_delete = {"rrsets": records} records = [] @@ -895,10 +897,10 @@ class Record(object): headers = {} headers['X-API-Key'] = PDNS_API_KEY jdata1 = utils.fetch_json(urlparse.urljoin(PDNS_STATS_URL, API_EXTENDED_URL + '/servers/localhost/zones/%s' % domain), headers=headers, method='PATCH', data=postdata_for_delete) - #logging.debug(jdata1) + logging.debug('jdata1: ', jdata1) jdata2 = utils.fetch_json(urlparse.urljoin(PDNS_STATS_URL, API_EXTENDED_URL + '/servers/localhost/zones/%s' % domain), headers=headers, method='PATCH', data=postdata_for_new) - #logging.debug(jdata2) + logging.debug('jdata2: ', jdata2) if 'error' in jdata2.keys(): logging.error('Cannot apply record changes.') diff --git a/app/templates/domain.html b/app/templates/domain.html index dc54ca4..a8674b8 100644 --- a/app/templates/domain.html +++ b/app/templates/domain.html @@ -152,10 +152,11 @@ var modal = $("#modal_delete"); var table = $("#tbl_records").DataTable(); var record = $(this).prop('id'); + var nRow = $(this).parents('tr')[0]; var info = "Are you sure you want to delete " + record + "?"; modal.find('.modal-body p').text(info); modal.find('#button_delete_confirm').click(function() { - table.row($(this).parents('tr')[0]).remove().draw(); + table.row(nRow).remove().draw(); modal.modal('hide'); }) modal.modal('show');