Allow slim view to be iframed. Refs #126

This commit is contained in:
Martin Mahner 2019-12-05 15:30:20 +01:00
parent d4c678eb73
commit 68d21874b5

View file

@ -1,6 +1,7 @@
from django.apps import apps from django.apps import apps
from django.conf import settings from django.conf import settings
from django.conf.urls import url from django.conf.urls import url
from django.views.decorators.clickjacking import xframe_options_exempt
from django.views.generic import TemplateView from django.views.generic import TemplateView
from .. import views from .. import views
@ -31,7 +32,11 @@ urlpatterns = [
), ),
url( url(
r'^(?P<snippet_id>[a-zA-Z0-9]{%d,})/slim/?$' % L, r'^(?P<snippet_id>[a-zA-Z0-9]{%d,})/slim/?$' % L,
views.SnippetDetailView.as_view(template_name='dpaste/details_slim.html'), xframe_options_exempt(
views.SnippetDetailView.as_view(
template_name='dpaste/details_slim.html'
)
),
name='snippet_details_slim', name='snippet_details_slim',
), ),
] ]