diff --git a/helpdesk/views/kb.py b/helpdesk/views/kb.py index ee164ea9..bbeacdef 100644 --- a/helpdesk/views/kb.py +++ b/helpdesk/views/kb.py @@ -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) diff --git a/helpdesk/views/public.py b/helpdesk/views/public.py index b9f5279b..4c41a023 100644 --- a/helpdesk/views/public.py +++ b/helpdesk/views/public.py @@ -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'