Merge branch 'master' of github.com:PowerDNS-Admin/PowerDNS-Admin into 1391-feature-mobile-first-responsive-ui-design

This commit is contained in:
Matt Scott 2023-02-20 10:45:20 -05:00
commit bd94c97486
2 changed files with 12 additions and 8 deletions

View File

@ -61,6 +61,7 @@ legal_envvars = (
'FILESYSTEM_SESSIONS_ENABLED',
'SESSION_COOKIE_SECURE',
'CSRF_COOKIE_SECURE',
'CAPTCHA_ENABLE',
)
legal_envvars_int = ('PORT', 'MAIL_PORT', 'SAML_METADATA_CACHE_LIFETIME')
@ -84,6 +85,7 @@ legal_envvars_bool = (
'FILESYSTEM_SESSIONS_ENABLED',
'SESSION_COOKIE_SECURE',
'CSRF_COOKIE_SECURE',
'CAPTCHA_ENABLE',
)
# import everything from environment variables

View File

@ -1109,11 +1109,13 @@ def api_zone_forward(server_id, zone_id):
if Setting().get('enable_api_rr_history'):
if request.method in ['POST', 'PATCH']:
data = request.get_json(force=True)
for rrset_data in data['rrsets']:
history = History(msg='{0} zone {1} record of {2}'.format(
rrset_data['changetype'].lower(), rrset_data['type'],
rrset_data['name'].rstrip('.')),
detail=json.dumps(data),
history = History(
msg='Apply record changes to domain {0}'.format(zone_id.rstrip('.')),
detail = json.dumps({
'domain': zone_id.rstrip('.'),
'add_rrsets': list(filter(lambda r: r['changetype'] == "REPLACE", data['rrsets'])),
'del_rrsets': list(filter(lambda r: r['changetype'] == "DELETE", data['rrsets']))
}),
created_by=g.apikey.description,
domain_id=Domain().get_id_by_name(zone_id.rstrip('.')))
history.add()