"No POST data" in error report #7899
Unanswered
bblanchon
asked this question in
Potential Issue
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I'm using Django 3.1.7 & DRF 3.12.2.
When an exception occurs in a
ViewSet
, Django automatically sends an email to the administrator.The problem is that the POST data is always empty in this email:
Instead, I expect to see the JSON payload that was sent in the request body.
I added a breakpoint in
django.utils.log.AdminEmailHandler.emit()
, and I can confirm thatrequest.POST
is empty.But on the other hand, I'm sure that
request.data
was not empty in theViewSet
.I verified that the request's
Content-Type
andX-Requested-With
are correctly set.The only non-standard middlewares I use are corsheaders and admin_reorder; I don't think they are related to this problem.
Can anyone help me get the JSON payload in the error report?
Best regards,
Benoit
Beta Was this translation helpful? Give feedback.
All reactions