Opened 12 years ago
Closed 12 years ago
#21912 closed Cleanup/optimization (fixed)
Improve error message "The view ___ didn't return an HttpResponse object."
| Reported by: | brycenesbitt | Owned by: | AeroNotix |
|---|---|---|---|
| Component: | Core (Other) | Version: | 1.7-alpha-1 |
| Severity: | Normal | Keywords: | |
| Cc: | Triage Stage: | Accepted | |
| Has patch: | no | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
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))
Change History (3)
comment:1 by , 12 years ago
| Triage Stage: | Unreviewed → Accepted |
|---|
comment:2 by , 12 years ago
| Owner: | changed from to |
|---|---|
| Status: | new → assigned |
comment:3 by , 12 years ago
| Resolution: | → fixed |
|---|---|
| Status: | assigned → closed |
Note:
See TracTickets
for help on using tickets.
In 1150053b994a6de665db51a18a07b992bd6714f1: