Opened 9 years ago

Last modified 9 years ago

#26253 closed Bug

TemplateResponse and SimpleTemplateResponse: error message causes TypeError — at Version 1

Reported by: David Reitter Owned by: nobody
Component: Template system Version: 1.8
Severity: Release blocker Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description (last modified by Tim Graham)

When TemplateResponse or SimpleTemplateResponse are called, a TypeError is thrown.

This is because their __init__() creates a BackendTemplate` giving only one argument to the constructor.

The resulting error is obviously confusing and obfuscates the warning.

The attached patch addresses the issue, although I am unsure whether one should assume, by default, that a DjangoTemplate was given.

Change History (2)

by David Reitter, 9 years ago

Attachment: response.patch added

comment:1 by Tim Graham, 9 years ago

Description: modified (diff)
Summary: TemplateResponse and BasicTemplateResponse: error message causes TypeErrorTemplateResponse and SimpleTemplateResponse: error message causes TypeError

Can you provide code to reproduce the issue? I'm not entirely clear on it based on the description. Is the issue relevant on master or only in 1.9 that has the deprecation path? If only 1.9, the problem may not be severe enough to warrant being patched there.

I edited the description to change BaseTemplateResponse to SimpleTemplateResponse since there's no class in Django with the former name. Please edit again if it should be something else.

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