Revision 584bdc72

b/snf-django-lib/snf_django/lib/api/__init__.py
188 188
        response["Date"] = format_date_time(time())
189 189

  
190 190
    if not response.has_header("Content-Length"):
191
        if response._is_string:
191
        # compatibility code for django 1.4
192
        _is_string = getattr(response, '_is_string', None)
193
        _base_content_is_iter = getattr(response, '_base_content_is_iter', None)
194
        if (_is_string is not None and _is_string) or\
195
                (_base_content_is_iter is not None and
196
                    not _base_content_is_iter):
192 197
            response["Content-Length"] = len(response.content)
193 198
        else:
194 199
            # save response content from been consumed if it is an iterator

Also available in: Unified diff