Show a proper confirmation page after adding an email to an org
authorMagnus Hagander <magnus@hagander.net>
Thu, 18 Nov 2021 13:21:05 +0000 (14:21 +0100)
committerMagnus Hagander <magnus@hagander.net>
Thu, 18 Nov 2021 13:21:42 +0000 (14:21 +0100)
This should (hopefully) help reduce some confusion.

pgweb/account/views.py
templates/account/orgemail_confirmed.html [new file with mode: 0644]

index ae42851c3e973f76557b5dfd8139ab7155d8248e..e7df5d8b3c34694e45d09ca1f23f4518f458db32 100644 (file)
@@ -297,6 +297,10 @@ def confirm_org_email(request, token):
     email.token = None
     email.save()
 
+    return render_pgweb(request, 'account', 'account/orgemail_confirmed.html', {
+        'org': email.org,
+        'email': email.address,
+    })
     return HttpResponseRedirect('/account/organisations/{}/'.format(email.org.id))
 
 
diff --git a/templates/account/orgemail_confirmed.html b/templates/account/orgemail_confirmed.html
new file mode 100644 (file)
index 0000000..d57ef1a
--- /dev/null
@@ -0,0 +1,11 @@
+{%extends "base/page.html"%}
+{%block title%}Email confirmed{%endblock%}
+{%block contents%}
+<p>
+  The email <em>{{email}}</em> has been confirmed for use in <em>{{org.name}}</em>,
+  and can now be used for submitting news.
+</p>
+<p>
+  <a class="btn btn-primary" href="/account/organisations/{{org.id}}/">Return to organisation</a>
+</p>
+{%endblock%}