From acc119f101a26c91246386534b6aea9893583943 Mon Sep 17 00:00:00 2001 From: Jennifer Richards Date: Thu, 1 Aug 2024 16:51:53 -0300 Subject: [PATCH 1/2] fix: require login to pdfize --- ietf/doc/views_doc.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ietf/doc/views_doc.py b/ietf/doc/views_doc.py index 42898d2098..815a512913 100644 --- a/ietf/doc/views_doc.py +++ b/ietf/doc/views_doc.py @@ -1039,6 +1039,8 @@ def document_html(request, name, rev=None): document_html=True, ) + +@login_required def document_pdfized(request, name, rev=None, ext=None): found = fuzzy_find_documents(name, rev) From 8a79de95a9d6aecb20768c5800d0ca3b677ccc9b Mon Sep 17 00:00:00 2001 From: Jennifer Richards Date: Thu, 1 Aug 2024 17:03:02 -0300 Subject: [PATCH 2/2] fix: suppress "pdfized" button when it won't work --- ietf/doc/views_doc.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ietf/doc/views_doc.py b/ietf/doc/views_doc.py index 815a512913..dfef40e558 100644 --- a/ietf/doc/views_doc.py +++ b/ietf/doc/views_doc.py @@ -265,6 +265,8 @@ def document_main(request, name, rev=None, document_html=False): can_change_stream = bool(can_edit or roles) file_urls, found_types = build_file_urls(doc) + if not request.user.is_authenticated: + file_urls = [fu for fu in file_urls if fu[0] != "pdfized"] content = doc.text_or_error() # pyflakes:ignore content = markup_txt.markup(maybe_split(content, split=split_content)) @@ -406,6 +408,8 @@ def document_main(request, name, rev=None, document_html=False): latest_revision = None file_urls, found_types = build_file_urls(doc) + if not request.user.is_authenticated: + file_urls = [fu for fu in file_urls if fu[0] != "pdfized"] content = doc.text_or_error() # pyflakes:ignore content = markup_txt.markup(maybe_split(content, split=split_content))