From bbcd4fc3550dccc6f53bc583f7d9b4d03fcdad53 Mon Sep 17 00:00:00 2001 From: Son NK Date: Sat, 25 Apr 2020 15:21:35 +0200 Subject: [PATCH] remove "trigger-email" --- app/dashboard/templates/dashboard/index.html | 20 ++++---------------- app/dashboard/views/index.py | 14 +------------- 2 files changed, 5 insertions(+), 29 deletions(-) diff --git a/app/dashboard/templates/dashboard/index.html b/app/dashboard/templates/dashboard/index.html index 7fdd74f6..dab6005d 100644 --- a/app/dashboard/templates/dashboard/index.html +++ b/app/dashboard/templates/dashboard/index.html @@ -223,9 +223,10 @@
+ class="save-mailbox btn btn-sm btn-outline-info w-100"> Update
@@ -409,19 +410,6 @@ }); }); - $(".trigger-email").on("click", function (e) { - notie.confirm({ - text: "SimpleLogin server will send an email to this alias " + - "and it will arrive to your inbox, please confirm.", - cancelCallback: () => { - // nothing to do - }, - submitCallback: () => { - $(this).closest("form").submit(); - } - }); - }); - $(".custom-switch-input").change(async function (e) { let aliasId = $(this).data("alias"); let alias = $(this).parent().find(".alias").val(); diff --git a/app/dashboard/views/index.py b/app/dashboard/views/index.py index c721b9fe..6f94a600 100644 --- a/app/dashboard/views/index.py +++ b/app/dashboard/views/index.py @@ -33,19 +33,7 @@ def index(): # User generates a new email if request.method == "POST": - if request.form.get("form-name") == "trigger-email": - alias_id = request.form.get("alias-id") - alias = Alias.get(alias_id) - - LOG.d("trigger an email to %s", alias) - email_utils.send_test_email_alias(alias.email, alias.user.name) - - flash( - f"An email sent to {alias.email} is on its way, please check your inbox/spam folder", - "success", - ) - - elif request.form.get("form-name") == "create-custom-email": + if request.form.get("form-name") == "create-custom-email": if current_user.can_create_new_alias(): return redirect(url_for("dashboard.custom_alias")) else: