mirror of
https://github.com/cwinfo/powerdns-admin.git
synced 2025-07-02 04:16:19 +00:00
Remove unnecessary call to str()
* json.dumps() already returns a str
This commit is contained in:
@ -409,12 +409,11 @@ def add():
|
||||
domain_id = Domain().get_id_by_name(domain_name)
|
||||
history = History(msg='Add domain {0}'.format(
|
||||
pretty_domain_name(domain_name)),
|
||||
detail=str(
|
||||
json.dumps({
|
||||
detail = json.dumps({
|
||||
'domain_type': domain_type,
|
||||
'domain_master_ips': domain_master_ips,
|
||||
'account_id': account_id
|
||||
})),
|
||||
}),
|
||||
created_by=current_user.username,
|
||||
domain_id=domain_id)
|
||||
history.add()
|
||||
@ -446,17 +445,16 @@ def add():
|
||||
history = History(
|
||||
msg='Applying template {0} to {1} successfully.'.
|
||||
format(template.name, domain_name),
|
||||
detail=str(
|
||||
json.dumps({
|
||||
"domain":
|
||||
detail = json.dumps({
|
||||
'domain':
|
||||
domain_name,
|
||||
"template":
|
||||
'template':
|
||||
template.name,
|
||||
"add_rrests":
|
||||
'add_rrests':
|
||||
result['data'][0]['rrsets'],
|
||||
"del_rrests":
|
||||
'del_rrests':
|
||||
result['data'][1]['rrsets']
|
||||
})),
|
||||
}),
|
||||
created_by=current_user.username,
|
||||
domain_id=domain_id)
|
||||
history.add()
|
||||
@ -465,7 +463,7 @@ def add():
|
||||
msg=
|
||||
'Failed to apply template {0} to {1}.'
|
||||
.format(template.name, domain_name),
|
||||
detail=str(json.dumps(result)),
|
||||
detail = json.dumps(result),
|
||||
created_by=current_user.username)
|
||||
history.add()
|
||||
return redirect(url_for('dashboard.dashboard'))
|
||||
@ -618,11 +616,10 @@ def change_soa_edit_api(domain_name):
|
||||
history = History(
|
||||
msg='Update soa_edit_api for domain {0}'.format(
|
||||
pretty_domain_name(domain_name)),
|
||||
detail=str(
|
||||
json.dumps({
|
||||
"domain": domain_name,
|
||||
"soa_edit_api": new_setting
|
||||
})),
|
||||
detail = json.dumps({
|
||||
'domain': domain_name,
|
||||
'soa_edit_api': new_setting
|
||||
}),
|
||||
created_by=current_user.username,
|
||||
domain_id=d.get_id_by_name(domain_name))
|
||||
history.add()
|
||||
@ -686,12 +683,11 @@ def record_apply(domain_name):
|
||||
if result['status'] == 'ok':
|
||||
history = History(
|
||||
msg='Apply record changes to domain {0}'.format(pretty_domain_name(domain_name)),
|
||||
detail=str(
|
||||
json.dumps({
|
||||
"domain": domain_name,
|
||||
"add_rrests": result['data'][0]['rrsets'],
|
||||
"del_rrests": result['data'][1]['rrsets']
|
||||
})),
|
||||
detail = json.dumps({
|
||||
'domain': domain_name,
|
||||
'add_rrests': result['data'][0]['rrsets'],
|
||||
'del_rrests': result['data'][1]['rrsets']
|
||||
}),
|
||||
created_by=current_user.username,
|
||||
domain_id=domain.id)
|
||||
history.add()
|
||||
@ -700,11 +696,10 @@ def record_apply(domain_name):
|
||||
history = History(
|
||||
msg='Failed to apply record changes to domain {0}'.format(
|
||||
pretty_domain_name(domain_name)),
|
||||
detail=str(
|
||||
json.dumps({
|
||||
"domain": domain_name,
|
||||
"msg": result['msg'],
|
||||
})),
|
||||
detail = json.dumps({
|
||||
'domain': domain_name,
|
||||
'msg': result['msg'],
|
||||
}),
|
||||
created_by=current_user.username)
|
||||
history.add()
|
||||
return make_response(jsonify(result), 400)
|
||||
|
Reference in New Issue
Block a user