﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
33674	Timezones cause 500 errors to not email the site admin	iragm		"I believe I have found a bug - my site was working great prior to adding support for localization/timezones and if a user encountered a 500 internal server error, I'd get an email about it and could fix it.  I added support for timezones, and **stopped getting the alert emails** -- and the users are no longer sent to my 500 page.

Here's some information:
* debug=True causes things to work correctly (no email sent, debug info displayed to the user)
* this does not happen in a development environment at all as far as I can tell
* I am using Channels and Daphne to serve content behind an Nginx reverse proxy
* Edit: using python3 manage.py runserver with debug=False returns the correct 500 page.  This issue is only happening when running with Daphne.
* When 500 errors happen, the user gets redirected to a very generic Daphne ""exception inside application"" page.  Before you blame this on Daphne, please keep reading...
* The error log traceback points to `site-packages/django/templatetags/tz.py`

If I change this class to look as follows:
{{{
    def render(self, context):
        try:
            with timezone.override(self.tz.resolve(context)):
                output = self.nodelist.render(context)
            return output
        except:
            return self.nodelist.render(context)
}}}
the correct 500 error page is rendered and the email goes out to me telling me where the error occurred.  That suggests to me that something in timezone.override isn't working as it should be.

I could just make a PR with this but I am not really sure what consequences this change has.

I know there's a lack of info in this, and I apologize in advance. Because I only see this issue on my production server, I have to take my whole site down to try to test and troubleshoot it."	Bug	closed	Error reporting	4.0	Normal	needsinfo			Unreviewed	0	0	0	0	0	0
