From 145bed893f084b8a50342c3283b18e47c0085e39 Mon Sep 17 00:00:00 2001 From: Son NK Date: Wed, 5 Feb 2020 17:36:06 +0700 Subject: [PATCH] user can set note when creating custom alias --- .../templates/dashboard/custom_alias.html | 16 ++++++++++++++-- app/dashboard/views/custom_alias.py | 5 ++++- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/app/dashboard/templates/dashboard/custom_alias.html b/app/dashboard/templates/dashboard/custom_alias.html index d4bae6fb..984cdd0e 100644 --- a/app/dashboard/templates/dashboard/custom_alias.html +++ b/app/dashboard/templates/dashboard/custom_alias.html @@ -48,8 +48,20 @@ -
- +
+
+ +
+
+ + +
+
+ +
diff --git a/app/dashboard/views/custom_alias.py b/app/dashboard/views/custom_alias.py index f1b5d7f2..6b7cb0d2 100644 --- a/app/dashboard/views/custom_alias.py +++ b/app/dashboard/views/custom_alias.py @@ -46,6 +46,7 @@ def custom_alias(): if request.method == "POST": alias_prefix = request.form.get("prefix") alias_suffix = request.form.get("suffix") + alias_note = request.form.get("note") if verify_prefix_suffix( current_user, alias_prefix, alias_suffix, user_custom_domains @@ -61,7 +62,9 @@ def custom_alias(): "warning", ) else: - gen_email = GenEmail.create(user_id=current_user.id, email=full_alias) + gen_email = GenEmail.create( + user_id=current_user.id, email=full_alias, note=alias_note + ) # get the custom_domain_id if alias is created with a custom domain alias_domain = get_email_domain_part(full_alias)