forked from GithubBackups/healthchecks
hc.api.views.bounce handles transient email bounces (logs error, does not disable the integration)
This commit is contained in:
parent
74ad152cc5
commit
c521b44d20
@ -54,3 +54,13 @@ class BounceTestCase(BaseTestCase):
|
||||
url = "/api/v1/notifications/%s/bounce" % self.n.code
|
||||
r = self.client.get(url)
|
||||
self.assertEqual(r.status_code, 405)
|
||||
|
||||
def test_does_not_unsubscribe_transient_bounces(self):
|
||||
url = "/api/v1/notifications/%s/bounce?type=Transient" % self.n.code
|
||||
self.client.post(url, "foo", content_type="text/plain")
|
||||
|
||||
self.n.refresh_from_db()
|
||||
self.assertEqual(self.n.error, "foo")
|
||||
|
||||
self.channel.refresh_from_db()
|
||||
self.assertTrue(self.channel.email_verified)
|
||||
|
@ -272,8 +272,9 @@ def bounce(request, code):
|
||||
notification.error = request.body.decode()[:200]
|
||||
notification.save()
|
||||
|
||||
notification.channel.email_verified = False
|
||||
notification.channel.save()
|
||||
if request.GET.get("type") in (None, "Permanent"):
|
||||
notification.channel.email_verified = False
|
||||
notification.channel.save()
|
||||
|
||||
return HttpResponse()
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user