Ticket #16935: 16935.diff

File 16935.diff, 1.2 KB (added by Ivan Sagalaev, 13 years ago)

Patch

  • django/template/response.py

    === modified file 'django/template/response.py'
     
    5454
    5555        return obj_dict
    5656
    57     def __getattr__(self, name):
    58         if name in self.rendering_attrs:
    59             raise DiscardedAttributeError('The %s attribute was discarded '
    60                                           'when this %s class was pickled.' %
    61                                           (name, self.__class__.__name__))
    62         return super(SimpleTemplateResponse, self).__getattr__(name)
     57    def __getattribute__(self, name):
     58        try:
     59            return super(SimpleTemplateResponse, self).__getattribute__(name)
     60        except AttributeError:
     61            if name in self.rendering_attrs:
     62                raise DiscardedAttributeError('The %s attribute was discarded '
     63                                              'when this %s class was pickled.' %
     64                                              (name, self.__class__.__name__))
     65            raise
     66
     67
    6368
    6469    def resolve_template(self, template):
    6570        "Accepts a template object, path-to-template or list of paths"
Back to Top