Skip to content

Commit

Permalink
Fixed the Django 1.3 compat
Browse files Browse the repository at this point in the history
  • Loading branch information
xordoquy committed Jul 29, 2014
1 parent 4210fed commit 59d0a03
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion rest_framework/response.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
The appropriate renderer is called during Django's template response rendering.
"""
from __future__ import unicode_literals
import django
from django.core.handlers.wsgi import STATUS_CODE_TEXT
from django.template.response import SimpleTemplateResponse
from rest_framework.compat import six
Expand All @@ -15,7 +16,9 @@ class Response(SimpleTemplateResponse):
An HttpResponse that allows its data to be rendered into
arbitrary media types.
"""
rendering_attrs = SimpleTemplateResponse.rendering_attrs + ['_closable_objects']
# TODO: remove that once Django 1.3 isn't supported
if django.VERSION > (1, 3):
rendering_attrs = SimpleTemplateResponse.rendering_attrs + ['_closable_objects']

def __init__(self, data=None, status=200,
template_name=None, headers=None,
Expand Down

0 comments on commit 59d0a03

Please sign in to comment.