X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/293deaa71a6e390517966f4ba9fa907562524636..e883fa899b3df6e047f9e821a7ca81f53a02ddba:/apps/catalogue/views.py?ds=sidebyside 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,), {}