omab/django-social-auth — pull request #662 by eshellman (2013-04-09 03:58:16+00:00)
Title: allow middleware to catch exceptions when DEBUG = True

I had been puzzled for weeks because it seemed like the advertised functionality of the exception handling middleware never seemed to work. I finally had time to dig into the code, and discovered that it never handles exceptions when settings.DEBUG is set to true. Since I always develop with DEBUG = True, the exceptions never got caught.

I realize that when developing the DSA, this makes sense, but for users trying to deploy DSA in a larger project, this forces them to turn DEBUG = False in order to develop proper exception handling in the project, which is against expectation. These exceptions are "normal" conditions such as a user deciding not to allow 3rd party authentication.

All of the functionality needed for debugging inside DSA is provided by SOCIAL_AUTH_RAISE_EXCEPTIONS, so the or-ing it with DEBUG is just confusing to deployers