mirror of
https://github.com/pacnpal/django-anymail.git
synced 2025-12-20 03:41:05 -05:00
send back a message and redirect to admin home if mandrill returns anything but a 200
This commit is contained in:
@@ -75,7 +75,9 @@ class DjrillApiJsonObjectsMixin(object):
|
||||
data=payload)
|
||||
if req.status_code == 200:
|
||||
return req.content
|
||||
raise Exception("Mandrill did not return a 200.")
|
||||
messages.error(self.request,
|
||||
"Mandrill returned something other than a 200.")
|
||||
return HttpResponseRedirect(reverse("admin:index"))
|
||||
|
||||
|
||||
class DjrillIndexView(DjrillApiMixin, TemplateView):
|
||||
|
||||
Reference in New Issue
Block a user