set mailbox.pgp_finger_print when adding PGP key
This commit is contained in:
parent
2eef010bad
commit
486df7fefc
|
@ -14,6 +14,7 @@ from app.extensions import db
|
|||
from app.log import LOG
|
||||
from app.models import GenEmail, DeletedAlias
|
||||
from app.models import Mailbox
|
||||
from app.pgp_utils import PGPException, load_public_key
|
||||
|
||||
|
||||
class ChangeEmailForm(FlaskForm):
|
||||
|
@ -96,8 +97,11 @@ def mailbox_detail_route(mailbox_id):
|
|||
elif request.form.get("form-name") == "pgp":
|
||||
if request.form.get("action") == "save":
|
||||
mailbox.pgp_public_key = request.form.get("pgp")
|
||||
# TODO
|
||||
# mailbox.pgp_finger_print = load_public_key(mailbox.pgp_public_key)
|
||||
try:
|
||||
mailbox.pgp_finger_print = load_public_key(mailbox.pgp_public_key)
|
||||
except PGPException:
|
||||
flash("Cannot add the public key, please verify it", "error")
|
||||
else:
|
||||
db.session.commit()
|
||||
flash("Your PGP public key is saved successfully", "success")
|
||||
return redirect(
|
||||
|
|
Loading…
Reference in a new issue