[Django] #21912: Improve error message "The view ___ didn't return an HttpResponse object."

7 views
Skip to first unread message

Django

unread,
Jan 30, 2014, 1:37:58 PM1/30/14
to django-...@googlegroups.com
#21912: Improve error message "The view ___ didn't return an HttpResponse object."
--------------------------------------+-------------------------
Reporter: brycenesbitt | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Core (Other) | Version: 1.7-alpha-1
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+-------------------------
The error message "The view _ didn't return an HttpResponse object." in
base.py leaves
open the question "What did it return"? This is a proposal to change the
message to:

"The view _ returned None: an HttpResponse object was expected."

The code in question is:

{{{
# Complain if the view returned None (a common error).
if response is None:
if isinstance(callback, types.FunctionType): # FBV
view_name = callback.__name__
else: # CBV
view_name = callback.__class__.__name__ +
'.__call__'
raise ValueError("The view %s.%s didn't return an
HttpResponse object."
% (callback.__module__, view_name))
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/21912>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Jan 30, 2014, 3:04:57 PM1/30/14
to django-...@googlegroups.com
#21912: Improve error message "The view ___ didn't return an HttpResponse object."
-------------------------------------+-------------------------------------
Reporter: brycenesbitt | Owner: nobody
Type: | Status: new
Cleanup/optimization | Version:
Component: Core (Other) | 1.7-alpha-1
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by mjtamlyn):

* needs_better_patch: => 0
* needs_docs: => 0
* needs_tests: => 0
* stage: Unreviewed => Accepted


--
Ticket URL: <https://code.djangoproject.com/ticket/21912#comment:1>

Django

unread,
Feb 15, 2014, 9:55:04 AM2/15/14
to django-...@googlegroups.com
#21912: Improve error message "The view ___ didn't return an HttpResponse object."
-------------------------------------+-------------------------------------
Reporter: brycenesbitt | Owner: AeroNotix
Type: | Status: assigned

Cleanup/optimization | Version:
Component: Core (Other) | 1.7-alpha-1
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by AeroNotix):

* owner: nobody => AeroNotix
* status: new => assigned


--
Ticket URL: <https://code.djangoproject.com/ticket/21912#comment:2>

Django

unread,
Feb 15, 2014, 11:18:37 AM2/15/14
to django-...@googlegroups.com
#21912: Improve error message "The view ___ didn't return an HttpResponse object."
-------------------------------------+-------------------------------------
Reporter: brycenesbitt | Owner: AeroNotix
Type: | Status: closed

Cleanup/optimization | Version:
Component: Core (Other) | 1.7-alpha-1
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham <timograham@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"1150053b994a6de665db51a18a07b992bd6714f1"]:
{{{
#!CommitTicketReference repository=""
revision="1150053b994a6de665db51a18a07b992bd6714f1"
Fixed #21912 -- Improved error message if a view returns None.

Thanks brycenesbitt for the report.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/21912#comment:3>

Reply all
Reply to author
Forward
0 new messages