mirror of
https://github.com/mail-in-a-box/mailinabox.git
synced 2024-11-24 02:37:05 +00:00
bug fix on error message
This commit is contained in:
parent
8574b43542
commit
3d2a526fe0
@ -364,6 +364,26 @@ def ssl_get_csr(domain):
|
|||||||
ssl_private_key = os.path.join(os.path.join(env["STORAGE_ROOT"], 'ssl', 'ssl_private_key.pem'))
|
ssl_private_key = os.path.join(os.path.join(env["STORAGE_ROOT"], 'ssl', 'ssl_private_key.pem'))
|
||||||
return create_csr(domain, ssl_private_key, request.form.get('countrycode', ''), env)
|
return create_csr(domain, ssl_private_key, request.form.get('countrycode', ''), env)
|
||||||
|
|
||||||
|
|
||||||
|
def return_message(item):
|
||||||
|
if item['result'] == 'skipped':
|
||||||
|
return {
|
||||||
|
"title": item["result"].capitalize(),
|
||||||
|
"log": "\n".join(item['log']),
|
||||||
|
}
|
||||||
|
elif item['result'] == 'installed':
|
||||||
|
return {
|
||||||
|
"title": item["result"].capitalize(),
|
||||||
|
"log": "Your certificate containing these domains " + ",".join(
|
||||||
|
item['domains']) + " have been renewed",
|
||||||
|
}
|
||||||
|
else:
|
||||||
|
return {
|
||||||
|
"title": item["result"].capitalize(),
|
||||||
|
"log": "\n".join(item['log'])
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@app.route('/ssl/renew/<domain>', methods=['POST'])
|
@app.route('/ssl/renew/<domain>', methods=['POST'])
|
||||||
@authorized_personnel_only
|
@authorized_personnel_only
|
||||||
def ssl_renew(domain):
|
def ssl_renew(domain):
|
||||||
@ -410,27 +430,19 @@ def ssl_renew(domain):
|
|||||||
"log": "Sorry, something is not right!",
|
"log": "Sorry, something is not right!",
|
||||||
})
|
})
|
||||||
|
|
||||||
|
ret_message = {"title": "", "log": ""}
|
||||||
for item in status:
|
for item in status:
|
||||||
if isinstance(status, str):
|
if isinstance(item, str):
|
||||||
continue
|
continue
|
||||||
else:
|
elif existing_key == "no":
|
||||||
if domain in item['domains']:
|
message = return_message(item)
|
||||||
if item['result'] == 'skipped':
|
ret_message["title"] = message["title"]
|
||||||
return json_response({
|
ret_message["log"] += "\n" + message["log"]
|
||||||
"title": item["result"].capitalize(),
|
elif existing_key == "yes" and domain in item["domains"]:
|
||||||
"log": "\n".join(item['log']),
|
return json_response(return_message(item))
|
||||||
})
|
return json_response(ret_message)
|
||||||
elif item['result'] == 'installed':
|
|
||||||
return json_response({
|
|
||||||
"title": item["result"].capitalize(),
|
|
||||||
"log": "Your certificate containing these domains " + ",".join(
|
|
||||||
item['domains']) + " have been renewed",
|
|
||||||
})
|
|
||||||
else:
|
|
||||||
return json_response({
|
|
||||||
"title": item["result"].capitalize(),
|
|
||||||
"log": "\n".join(item['log'])
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
@app.route('/ssl/install', methods=['POST'])
|
@app.route('/ssl/install', methods=['POST'])
|
||||||
|
Loading…
Reference in New Issue
Block a user