Simple is in the eye of the beholder.  Unless someone we haven't heard from
comes up with pre-existing switches or sub filtering attachment points, I
see two possibilities.

1. Patch or monkey patch the code that decides to send the e-mail to check
for this case to omit the e-mail.  This has to be checked whenever Django
gets updated, but only adds work when an error is being returned.
2. At the WSGI application level, add code (essentially a middleware in the
the WSGI meaning of the word) to check whether the request *would* cause
this problem, return the 400 yourself, and skip calling down into Django.
The WSGI interface is stable, and should be proof against future upgrades,
but this affects the performance of every request.

I'd go with 1, unless the site doesn't require best performance.


On Fri, Dec 6, 2013 at 11:28 AM, Jon Dufresne <jon.dufre...@gmail.com>wrote:

> On Fri, Dec 6, 2013 at 7:47 AM, Zach Borboa <zachbor...@gmail.com> wrote:
> > SuspiciousOperation should now return a 400 error [1].
>
> It is true, the response is a 400 Bad Request error, but I still
> receive emails going to my admins/managers email account. I thought
> 400 errors shouldn't be mailed out. I would prefer to avoid installing
> Sentry if there is a simple fix. Any ideas?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CADhq2b7C7X2%2Bx%3DOUkaECzBMftNBoxM%3D_h%2BhHJbPmZ%3DfV3X%2B3kA%40mail.gmail.com
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAB%2BAj0tEDURemDKs8PEyrtVFw9mdehQze9UM8NY%2B%3DyppKtPkNA%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to