aboutsummaryrefslogtreecommitdiffstats
path: root/rest_framework/renderers.py
diff options
context:
space:
mode:
authorTom Christie2012-09-28 11:53:51 +0100
committerTom Christie2012-09-28 11:53:51 +0100
commit84f775803994ccd82671dd4a6f9b4d87aa36dc31 (patch)
treea28f8213f0ebce048b163d79d5c3e182b3f20171 /rest_framework/renderers.py
parentaeeb68f68a8f5a3deb9f1ad06f11dbbd9a8f1ff6 (diff)
downloaddjango-rest-framework-84f775803994ccd82671dd4a6f9b4d87aa36dc31.tar.bz2
Remove support for doctests
Diffstat (limited to 'rest_framework/renderers.py')
-rw-r--r--rest_framework/renderers.py7
1 files changed, 2 insertions, 5 deletions
diff --git a/rest_framework/renderers.py b/rest_framework/renderers.py
index 35a2a733..8f2a3570 100644
--- a/rest_framework/renderers.py
+++ b/rest_framework/renderers.py
@@ -5,13 +5,13 @@ Django REST framework also provides HTML and PlainText renderers that help self-
by serializing the output along with documentation regarding the View, output status and headers,
and providing forms and links depending on the allowed methods, renderers and parsers on the View.
"""
-import copy
import string
from django import forms
from django.template import RequestContext, loader
from django.utils import simplejson as json
from rest_framework.compat import yaml
from rest_framework.settings import api_settings
+from rest_framework.request import clone_request
from rest_framework.utils import dict2xml
from rest_framework.utils import encoders
from rest_framework.utils.breadcrumbs import get_breadcrumbs
@@ -227,12 +227,9 @@ class DocumentingHTMLRenderer(BaseRenderer):
if not api_settings.FORM_METHOD_OVERRIDE:
return # Cannot use form overloading
- temp = request._method
- request._method = method.upper()
+ request = clone_request(request, method)
if not view.has_permission(request):
- request._method = temp
return # Don't have permission
- request._method = temp
if method == 'DELETE' or method == 'OPTIONS':
return True # Don't actually need to return a form