Skip to content

Commit 79cbeb2

Browse files
committed
Adjust the api_docs_view permissions #313
Signed-off-by: tdruez <[email protected]>
1 parent 6c00982 commit 79cbeb2

File tree

3 files changed

+2
-90
lines changed

3 files changed

+2
-90
lines changed

dejacode/urls.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
from django.conf.urls import include
1111
from django.contrib import admin
1212
from django.contrib.auth import views as auth_views
13+
from django.contrib.auth.decorators import login_required
1314
from django.template.loader import render_to_string
1415
from django.urls import path
1516
from django.views.defaults import page_not_found
@@ -179,11 +180,8 @@
179180
public=False,
180181
)
181182

182-
# TODO: Force login_required on all API documentation URLs.
183-
# for doc_url in api_docs_urls[0]:
184-
# doc_url.callback = login_required(doc_url.callback)
185183
api_docs_patterns = [
186-
path("", api_docs_view.with_ui("redoc", cache_timeout=0), name="docs-index"),
184+
path("", login_required(api_docs_view.with_ui("redoc", cache_timeout=0)), name="docs-index"),
187185
]
188186

189187
urlpatterns += [

dje/templates/admin/docs/index.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919

2020
{% if code_style %}<style>{{ code_style }}</style>{% endif %}
2121
<script src="{% static 'rest_framework/js/coreapi-0.1.1.js' %}"></script>
22-
<script src="{% url 'api-docs:schema-js' %}"></script>
2322

2423
<script src="{% static 'rest_framework/js/jquery-3.7.1.min.js' %}"></script>
2524
<script src="{% static 'rest_framework/js/bootstrap.min.js' %}"></script>

dje/templates/rest_framework/docs/index.html

Lines changed: 0 additions & 85 deletions
This file was deleted.

0 commit comments

Comments
 (0)