X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/69b59e1dc5d93547a298830fc439a5608ebd6596..1cfd896963379af2d46a08dde3a3cbb24763066c:/apps/catalogue/views.py 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,), {}