aboutsummaryrefslogtreecommitdiffstats
path: root/djangorestframework
diff options
context:
space:
mode:
authorTom Christie2012-09-07 13:35:57 +0100
committerTom Christie2012-09-07 13:35:57 +0100
commit82056d89158a0e1a965af247da7380676bc19240 (patch)
tree0dd53d8f82151dcc174a89acbd25b92a664e08b8 /djangorestframework
parent07323d4cd639643d170a47fa6deaab7382f9568a (diff)
downloaddjango-rest-framework-82056d89158a0e1a965af247da7380676bc19240.tar.bz2
Add coverage to travis config
Diffstat (limited to 'djangorestframework')
-rw-r--r--djangorestframework/decorators.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/djangorestframework/decorators.py b/djangorestframework/decorators.py
index 314ea635..814f321a 100644
--- a/djangorestframework/decorators.py
+++ b/djangorestframework/decorators.py
@@ -6,6 +6,7 @@ from djangorestframework import exceptions
from djangorestframework import status
from djangorestframework.response import Response
from djangorestframework.request import Request
+from djangorestframework.settings import api_settings
def api_view(allowed_methods):
@@ -34,7 +35,8 @@ def api_view(allowed_methods):
if isinstance(response, Response):
response.request = request
-
+ if api_settings.FORMAT_SUFFIX_KWARG:
+ response.format = kwargs.get(api_settings.FORMAT_SUFFIX_KWARG, None)
return response
except exceptions.APIException as exc: