mirror of
https://gitea.mueller.network/extern/django-helpdesk.git
synced 2025-01-13 17:38:24 +01:00
Fix iframe views so they actually can be displayed
This commit is contained in:
parent
5da7069dbd
commit
4c1fda5991
@ -10,6 +10,7 @@ views/kb.py - Public-facing knowledgebase views. The knowledgebase is a
|
||||
|
||||
from django.http import HttpResponseRedirect
|
||||
from django.shortcuts import render, get_object_or_404
|
||||
from django.views.decorators.clickjacking import xframe_options_exempt
|
||||
|
||||
from helpdesk import settings as helpdesk_settings
|
||||
from helpdesk.models import KBCategory, KBItem
|
||||
@ -51,7 +52,7 @@ def category(request, slug, iframe=False):
|
||||
'staff': staff,
|
||||
})
|
||||
|
||||
|
||||
@xframe_options_exempt
|
||||
def category_iframe(request, slug):
|
||||
return category(request, slug, iframe=True)
|
||||
|
||||
|
@ -13,6 +13,7 @@ from django.shortcuts import render
|
||||
from django.utils.http import urlquote
|
||||
from django.utils.translation import ugettext as _
|
||||
from django.conf import settings
|
||||
from django.views.decorators.clickjacking import xframe_options_exempt
|
||||
from django.views.generic.base import TemplateView
|
||||
from django.views.generic.edit import FormView
|
||||
|
||||
@ -100,6 +101,11 @@ class BaseCreateTicketView(abstract_views.AbstractCreateTicketMixin, FormView):
|
||||
class CreateTicketIframeView(BaseCreateTicketView):
|
||||
template_name = 'helpdesk/public_create_ticket_iframe.html'
|
||||
|
||||
@xframe_options_exempt
|
||||
def dispatch(self, *args, **kwargs):
|
||||
return super().dispatch(*args, **kwargs)
|
||||
|
||||
|
||||
|
||||
class CreateTicketView(BaseCreateTicketView):
|
||||
template_name = 'helpdesk/public_create_ticket.html'
|
||||
|
Loading…
Reference in New Issue
Block a user