diff options
| -rw-r--r-- | .travis.yml | 1 | ||||
| -rw-r--r-- | djangorestframework/decorators.py | 4 |
2 files changed, 4 insertions, 1 deletions
diff --git a/.travis.yml b/.travis.yml index 95de9493..a899701d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,6 +13,7 @@ install: - pip install $DJANGO - pip install -e . --use-mirrors - pip install -r requirements.txt + - pip install coverage==3.5.1 --use-mirrors script: - python setup.py test 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: |
