Opened 8 years ago

Closed 6 years ago

#15745 closed Bug (needsinfo)

Description of DEBUG setting in email is misleading if DEBUG == False.

Reported by: jMyles Owned by: jMyles
Component: User Experience Version: 1.3
Severity: Normal Keywords: debug, mail, errors, docstrings
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


If DEBUG == False, Django sends emails to those listed in the ADMIN setting with the exact text of the debug message.

At the bottom of this message is the following:

"You're seeing this error because you have DEBUG = True in your Django settings file. Change that to False, and Django will display a standard 500 page."

In the case that the message is displayed in an email, this content is misleading. Of course in order for the email to have been sent, we know that the user has DEBUG = False.

Thus, we need a short branch divorcing these two cases and displaying slightly different content.

Also (and please let me know if the convention is to separate these into two tickets) - there are some grammar issues with the docstrings - many need to be migrated to the present recurring tense / indicative mood if in fact that is going to remain the guideline.

Attachments (1)

debug_false_error_text.diff (1.7 KB) - added by jMyles 8 years ago.

Download all attachments as: .zip

Change History (6)

Changed 8 years ago by jMyles

Attachment: debug_false_error_text.diff added

comment:1 Changed 8 years ago by jMyles

Owner: changed from nobody to jMyles

comment:2 Changed 8 years ago by anonymous

Resolution: needsinfo
Status: newclosed

I'm confused. The problem with the email containing that incorrect "you're seeing this because" note was reported in #15597 and fixed in r15802. The attached patch shows that the the fix is in the version of the source you are using -- that block is bracketed by an {% if not is_email %}/{% endif %} (as are other portions of the template -- what gets sent in html email is not, in fact, exactly what would be sent to the browser). I tested the change then and again now, and when I receive HTML email from 1.3 it does NOT include the "You're seeing this because" paragraph. Are you really seeing this paragraph in HTML email with 1.3? Do you also get the other bits bracketed by {% if not is_email %} in your error emails?

(Also since r15850 html email is not the default it has to be explictly configured...I also checked the non-HTML email and it does not contain anything like that paragraph either.)

I don't believe it is necessary to say something else about why you are receiving this email. Anyone listed as an ADMIN in the settings file ought to already know why they are receiving this email.

comment:3 Changed 8 years ago by jMyles

Yep - you're right. I was still using 1.3 Beta 1 in that env. My bad!

In any case, I still like the idea of delivering an email to those listed as ADMIN. Even though it's true that knowing the full set of effects of DEBUG is indeed a reasonable expectation, which you point out, I also think that in reality some people find themselves in that tuple without being as familiar with django as we'd hope. If they are talented admins who come from another framework, this is exactly the kind of message that will help them in their transition. I think it's worth keeping.

comment:5 Changed 6 years ago by nagasthya@…

Resolution: needsinfo
Status: closedreopened

comment:6 Changed 6 years ago by Ramiro Morales

Resolution: needsinfo
Status: reopenedclosed
Note: See TracTickets for help on using tickets.
Back to Top