Debug display traces decorator instead of view on error
|Reported by:||briand||Owned by:||nobody|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
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.