From dec9efa0745469dba74fc78a992b9faf168dbd98 Mon Sep 17 00:00:00 2001
From: Patrick Jentsch <p.jentsch@uni-bielefeld.de>
Date: Tue, 9 Jul 2019 13:27:13 +0200
Subject: [PATCH] Add automatic confirmation mail after changing e-mail adress.

---
 app/auth/views.py                        | 1 +
 app/templates/auth/email/confirm.html.j2 | 1 -
 app/templates/auth/email/confirm.txt.j2  | 2 --
 3 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/app/auth/views.py b/app/auth/views.py
index 82c52853..b09c1f5d 100644
--- a/app/auth/views.py
+++ b/app/auth/views.py
@@ -139,6 +139,7 @@ def profile():
             current_user.confirmed = False
             db.session.add(current_user)
         db.session.commit()
+        resend_confirmation()
         return redirect(url_for('auth.profile'))
     return render_template('auth/profile.html.j2', form=form,
                            title='Profile')
diff --git a/app/templates/auth/email/confirm.html.j2 b/app/templates/auth/email/confirm.html.j2
index 599c4787..82ce9240 100644
--- a/app/templates/auth/email/confirm.html.j2
+++ b/app/templates/auth/email/confirm.html.j2
@@ -1,5 +1,4 @@
 <p>Dear {{ user.username }},</p>
-<p>Welcome to <b>Opaque</b>!</p>
 <p>To confirm your account please <a href="{{ url_for('auth.confirm', token=token, _external=True) }}">click here</a>.</p>
 <p>Alternatively, you can paste the following link in your browser's address bar:</p>
 <p>{{ url_for('auth.confirm', token=token, _external=True) }}</p>
diff --git a/app/templates/auth/email/confirm.txt.j2 b/app/templates/auth/email/confirm.txt.j2
index 5ba0670b..6421b7d0 100644
--- a/app/templates/auth/email/confirm.txt.j2
+++ b/app/templates/auth/email/confirm.txt.j2
@@ -1,7 +1,5 @@
 Dear {{ user.username }},
 
-Welcome to Opaque!
-
 To confirm your account please click on the following link:
 {{ url_for('auth.confirm', token=token, _external=True) }}
 
-- 
GitLab