X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/293deaa71a6e390517966f4ba9fa907562524636..f16a0ea5826b6ca41abca50c462de0f852e3ec5c:/apps/catalogue/views.py?ds=inline diff --git a/apps/catalogue/views.py b/apps/catalogue/views.py index 599fde1cb..fc27e02f3 100644 --- a/apps/catalogue/views.py +++ b/apps/catalogue/views.py @@ -536,6 +536,11 @@ class CustomPDFFormView(AjaxableFormView): submit = ugettext_lazy('Download') honeypot = True + def __call__(self, *args, **kwargs): + if settings.NO_CUSTOM_PDF: + raise Http404('Custom PDF is disabled') + return super(CustomPDFFormView, self).__call__(*args, **kwargs) + def form_args(self, request, obj): """Override to parse view args and give additional args to the form.""" return (obj,), {}