Opened 10 years ago

Closed 10 years ago

#6539 closed (duplicate)

Debug display traces decorator instead of view on error

Reported by: briand Owned by: nobody
Component: Uncategorized Version: master
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


I'm not sure what other error conditions may cause this to happen, but in my case it was a decorated view function where I forgot to return an HttpResponse object.

The view function:

def index(request):

Throws the debugger page message:

The view django.contrib.auth.decorators._CheckLogin.__call__ didn't return an HttpResponse object.

And only shows the traceback on the decorator, no traceback context for the actual failing view is displayed. Any reasonably astute developer would realize where the error is really coming from, but given an otherwise complete view it took me a few minutes to realize my last statement was a render_to_response call without a preceeding return statement.

Change History (1)

comment:1 Changed 10 years ago by Malcolm Tredinnick

Resolution: duplicate
Status: newclosed

This is essentially a variation on #5701 (and some other related tickets) regarding setting up attributes on decorators correctly.

Note: See TracTickets for help on using tickets.
Back to Top