1 | | This commit broke pickling of `HttpResponse` objects :( |
| 1 | This commit broke pickling of `HttpResponse` objects :( Possible solution: |
| 2 | |
| 3 | {{{ |
| 4 | --- a/django/http/response.py |
| 5 | +++ b/django/http/response.py |
| 6 | @@ -260,9 +260,10 @@ class HttpResponse(HttpResponseBase): |
| 7 | else: |
| 8 | self._container = [value] |
| 9 | self._base_content_is_iter = False |
| 10 | - self._iterator = iter(self._container) |
| 11 | |
| 12 | def __iter__(self): |
| 13 | + if not hasattr(self, '_iterator'): |
| 14 | + self._iterator = iter(self._container) |
| 15 | return self |
| 16 | |
| 17 | def __next__(self): |
| 18 | }}} |