Browse Source

Hide the "Confirmation Needed" notice if email channel verification is turned off. Update changelog.

pull/241/head
Pēteris Caune 6 years ago
parent
commit
499720a156
No known key found for this signature in database GPG Key ID: E28D7679E9A9EDE2
4 changed files with 11 additions and 0 deletions
  1. +1
    -0
      CHANGELOG.md
  2. +7
    -0
      hc/front/tests/test_add_email.py
  3. +1
    -0
      hc/front/views.py
  4. +2
    -0
      templates/integrations/add_email.html

+ 1
- 0
CHANGELOG.md View File

@ -6,6 +6,7 @@ All notable changes to this project will be documented in this file.
### Improvements
- Add the EMAIL_USE_VERIFICATION configuration setting (#232)
- Show "Badges" and "Settings" in top navigation (#234)
- Upgrade to Django 2.2
## 1.6.0 - 2019-04-01


+ 7
- 0
hc/front/tests/test_add_email.py View File

@ -12,6 +12,7 @@ class AddEmailTestCase(BaseTestCase):
self.client.login(username="[email protected]", password="password")
r = self.client.get(self.url)
self.assertContains(r, "Get an email message")
self.assertContains(r, "Confirmation needed")
def test_it_creates_channel(self):
form = {"value": "[email protected]"}
@ -58,6 +59,12 @@ class AddEmailTestCase(BaseTestCase):
c = Channel.objects.get()
self.assertEqual(c.value, "[email protected]")
@override_settings(EMAIL_USE_VERIFICATION=False)
def test_it_hides_confirmation_needed_notice(self):
self.client.login(username="[email protected]", password="password")
r = self.client.get(self.url)
self.assertNotContains(r, "Confirmation needed")
@override_settings(EMAIL_USE_VERIFICATION=False)
def test_it_auto_verifies_email(self):
form = {"value": "[email protected]"}


+ 1
- 0
hc/front/views.py View File

@ -698,6 +698,7 @@ def add_email(request):
ctx = {
"page": "channels",
"project": request.project,
"use_verification": settings.EMAIL_USE_VERIFICATION,
"form": form
}
return render(request, "integrations/add_email.html", ctx)


+ 2
- 0
templates/integrations/add_email.html View File

@ -16,11 +16,13 @@
Add multiple email addresses, to notify multiple team members.
</p>
{% if use_verification %}
<p>
<strong>Confirmation needed.</strong>
After entering an email address, {% site_name %} will send out a confirmation link.
Only confirmed addresses will receive notifications.
</p>
{% endif %}
<h2>Integration Settings</h2>


Loading…
Cancel
Save