Skip to content

Commit

Permalink
fix: require login to pdfize (#7775)
Browse files Browse the repository at this point in the history
* fix: require login to pdfize

* fix: suppress "pdfized" button when it won't work
  • Loading branch information
jennifer-richards committed Aug 1, 2024
1 parent fb1942a commit 06677a9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ietf/doc/views_doc.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Expand Down Expand Up @@ -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))

Expand Down Expand Up @@ -1039,6 +1043,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)
Expand Down

0 comments on commit 06677a9

Please sign in to comment.