user can update note in alias list page
This commit is contained in:
parent
145bed893f
commit
11b04d5e4a
|
@ -151,6 +151,28 @@
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<form method="post">
|
||||||
|
<div class="row mt-2">
|
||||||
|
|
||||||
|
<div class="col-10">
|
||||||
|
<textarea
|
||||||
|
name="note"
|
||||||
|
class="form-control"
|
||||||
|
rows="2"
|
||||||
|
placeholder="Alias Note.">{{ gen_email.note or "" }}</textarea>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-2">
|
||||||
|
<input type="hidden" name="form-name" value="set-note">
|
||||||
|
<input type="hidden" name="gen-email-id" value="{{ gen_email.id }}">
|
||||||
|
|
||||||
|
<button class="btn btn-sm btn-outline-success">
|
||||||
|
Save
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
|
||||||
<div class="row mt-3">
|
<div class="row mt-3">
|
||||||
<div class="col">
|
<div class="col">
|
||||||
{% if gen_email.enabled %}
|
{% if gen_email.enabled %}
|
||||||
|
|
|
@ -124,6 +124,21 @@ def index():
|
||||||
LOG.error("alias %s has been added before to DeletedAlias", email)
|
LOG.error("alias %s has been added before to DeletedAlias", email)
|
||||||
db.session.rollback()
|
db.session.rollback()
|
||||||
|
|
||||||
|
elif request.form.get("form-name") == "set-note":
|
||||||
|
gen_email_id = request.form.get("gen-email-id")
|
||||||
|
gen_email: GenEmail = GenEmail.get(gen_email_id)
|
||||||
|
note = request.form.get("note")
|
||||||
|
|
||||||
|
gen_email.note = note
|
||||||
|
db.session.commit()
|
||||||
|
|
||||||
|
flash(f"Update note for alias {gen_email.email}", "success")
|
||||||
|
return redirect(
|
||||||
|
url_for(
|
||||||
|
"dashboard.index", highlight_gen_email_id=gen_email.id, query=query
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
return redirect(url_for("dashboard.index", query=query))
|
return redirect(url_for("dashboard.index", query=query))
|
||||||
|
|
||||||
client_users = (
|
client_users = (
|
||||||
|
|
Loading…
Reference in a new issue