From 64f7968af93d3ea27eae2493eb6c3ce669b532b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20BECOT?= Date: Fri, 6 May 2022 10:17:03 +0200 Subject: [PATCH] fix: Use json.dumps instead of str --- powerdnsadmin/models/domain.py | 3 ++- powerdnsadmin/routes/domain.py | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/powerdnsadmin/models/domain.py b/powerdnsadmin/models/domain.py index d2bb197..3db1a99 100644 --- a/powerdnsadmin/models/domain.py +++ b/powerdnsadmin/models/domain.py @@ -1,3 +1,4 @@ +import json import re import traceback from flask import current_app @@ -421,7 +422,7 @@ class Domain(db.Model): if result['status'] == 'ok': history = History(msg='Add reverse lookup domain {0}'.format( domain_reverse_name), - detail=str({ + detail=json.dumps({ 'domain_type': 'Master', 'domain_master_ips': '' }), diff --git a/powerdnsadmin/routes/domain.py b/powerdnsadmin/routes/domain.py index 1d922be..fe9e98c 100644 --- a/powerdnsadmin/routes/domain.py +++ b/powerdnsadmin/routes/domain.py @@ -544,7 +544,7 @@ def setting(domain_name): history = History( msg='Change domain {0} access control'.format( pretty_domain_name(domain_name)), - detail=str({'user_has_access': new_user_list}), + detail=json.dumps({'user_has_access': new_user_list}), created_by=current_user.username, domain_id=d.id) history.add() @@ -582,7 +582,7 @@ def change_type(domain_name): if status['status'] == 'ok': history = History(msg='Update type for domain {0}'.format( pretty_domain_name(domain_name)), - detail=str({ + detail=json.dumps({ "domain": domain_name, "type": domain_type, "masters": domain_master_ips