diff options
| author | Luke Plant <L.Plant.98@cantab.net> | 2011-09-30 11:46:23 +0000 |
|---|---|---|
| committer | Luke Plant <L.Plant.98@cantab.net> | 2011-09-30 11:46:23 +0000 |
| commit | 10d90cba83d5dfbe52eb5501279c3db71b42dd41 (patch) | |
| tree | 4778f76411706c9de023ce89f2451d43dcdd8bdf /django | |
| parent | 5009e45dfe366ebf520eecb49d72d5a11cee1623 (diff) | |
Fixed #16935 - misleading message if AttributeError escapes during SimpleTemplateResponse.render
Thanks to isagalaev for the report.
As discussed on django-devs, this reverts some of the changes in [16568]
i.e. the addition of `SimpleTemplateResponse.__getattr__`, because this
makes it much harder to debug the common case of an AttributeError somewhere
during the rendering of a SimpleTemplateResponse.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16917 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django')
| -rw-r--r-- | django/template/response.py | 12 |
1 files changed, 0 insertions, 12 deletions
diff --git a/django/template/response.py b/django/template/response.py index 990a17b6bf..bb0b9cbf9d 100644 --- a/django/template/response.py +++ b/django/template/response.py @@ -6,10 +6,6 @@ class ContentNotRenderedError(Exception): pass -class DiscardedAttributeError(AttributeError): - pass - - class SimpleTemplateResponse(HttpResponse): rendering_attrs = ['template_name', 'context_data', '_post_render_callbacks'] @@ -36,7 +32,6 @@ class SimpleTemplateResponse(HttpResponse): # True, so we initialize it to False after the call to super __init__. self._is_rendered = False - def __getstate__(self): """Pickling support function. @@ -54,13 +49,6 @@ class SimpleTemplateResponse(HttpResponse): return obj_dict - def __getattr__(self, name): - if name in self.rendering_attrs: - raise DiscardedAttributeError('The %s attribute was discarded ' - 'when this %s class was pickled.' % - (name, self.__class__.__name__)) - return super(SimpleTemplateResponse, self).__getattr__(name) - def resolve_template(self, template): "Accepts a template object, path-to-template or list of paths" if isinstance(template, (list, tuple)): |
