aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Christie2012-10-09 12:48:49 +0100
committerTom Christie2012-10-09 12:48:49 +0100
commit7c4d50f621a9c0668b8f8992751de6b2d7bcbe29 (patch)
treed3915b7e872765bc4945c8bc5929daf7f861bd9c
parente9475d036ff2fa0244ca0f947192ffa842391784 (diff)
downloaddjango-rest-framework-7c4d50f621a9c0668b8f8992751de6b2d7bcbe29.tar.bz2
Fix browseable API form display error for authenticated permissions
-rw-r--r--docs/index.md3
-rw-r--r--rest_framework/request.py4
-rw-r--r--rest_framework/templates/rest_framework/base.html2
3 files changed, 7 insertions, 2 deletions
diff --git a/docs/index.md b/docs/index.md
index 6a9f7980..c149d974 100644
--- a/docs/index.md
+++ b/docs/index.md
@@ -54,7 +54,7 @@ If you're intending to use the browserable API you'll want to add REST framework
url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework'))
)
-Note that the base URL can be whatever you want, but you must include `rest_framework.urls` with the `rest_framework` namespace.
+Note that the URL path can be whatever you want, but you must include `rest_framework.urls` with the `rest_framework` namespace.
## Quickstart
@@ -119,6 +119,7 @@ Run the tests:
./rest_framework/runtests/runtests.py
+For more information see the [Contributing to REST framework][contributing] section.
## Support
For support please see the [REST framework discussion group][group], or try the `#restframework` channel on `irc.freenode.net`.
diff --git a/rest_framework/request.py b/rest_framework/request.py
index 3725b3c9..0a57d376 100644
--- a/rest_framework/request.py
+++ b/rest_framework/request.py
@@ -41,6 +41,10 @@ def clone_request(request, method):
ret._content_type = request._content_type
ret._stream = request._stream
ret._method = method
+ if hasattr(request, '_user'):
+ ret._user = request._user
+ if hasattr(request, '_auth'):
+ ret._auth = request._auth
return ret
diff --git a/rest_framework/templates/rest_framework/base.html b/rest_framework/templates/rest_framework/base.html
index abf3672f..d26cb8f4 100644
--- a/rest_framework/templates/rest_framework/base.html
+++ b/rest_framework/templates/rest_framework/base.html
@@ -95,7 +95,7 @@
<form class="button-form" action="{{ request.get_full_path }}" method="POST" class="pull-right">
{% csrf_token %}
<input type="hidden" name="{{ api_settings.FORM_METHOD_OVERRIDE }}" value="OPTIONS" />
- <button class="btn btn-info js-tooltip" title="Make an OPTIONS request on the {{ name }} resource">OPTIONS</button>
+ <button class="btn btn-primary js-tooltip" title="Make an OPTIONS request on the {{ name }} resource">OPTIONS</button>
</form>
{% endif %}