Opened 16 years ago

Closed 16 years ago

#6539 closed (duplicate)

Debug display traces decorator instead of view on error

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

Description

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:

@login_required
def index(request):
    pass

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 by Malcolm Tredinnick, 16 years ago

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