mirror of
https://github.com/pacnpal/django-anymail.git
synced 2025-12-20 11:51:05 -05:00
Fix: webhook view post method
Gets the JSON data from the mandrill_events param. Also returns a 400 error if there's any issues loading the webhook request.
This commit is contained in:
@@ -166,7 +166,10 @@ class DjrillWebhookView(DjrillWebhookSecretMixin, View):
|
|||||||
return HttpResponse()
|
return HttpResponse()
|
||||||
|
|
||||||
def post(self, request, *args, **kwargs):
|
def post(self, request, *args, **kwargs):
|
||||||
data = json.loads(request.body)
|
try:
|
||||||
|
data = json.loads(request.POST.get('mandrill_events'))
|
||||||
|
except TypeError:
|
||||||
|
return HttpResponse(status=400)
|
||||||
|
|
||||||
for event in data:
|
for event in data:
|
||||||
signals.webhook_event.send(
|
signals.webhook_event.send(
|
||||||
|
|||||||
Reference in New Issue
Block a user