CVs: with contact details off, the holder's name is still in the PDF title, the file name and the DOCX title #512

Closed
opened 2026-10-01 10:47:12 +00:00 by tiagoagueda · 0 comments
Owner

Found on 2026-09-29 in a read-only review of postulo at 95348908d, by reading how a CV's title is built and rendering a CV with its contact block off.

Checked again on 2026-10-01 against main at 0a5cad587: still present. The code is now at documents/rendering.py:62-74 (document_title), documents/rendering.py:630-653 (the snapshot's title and file name), documents/rendering.py:552-560 (draft_name), documents/rendering.py:380 (the title cv_outline gives) and documents/models.py:716 (RenderedDocument.download_name); the themes, documents/views.py, documents/docx.py:250 and the test have not moved.

Unticking include contact details takes the name off the page and out of the PDF's /Author, and the theme says why: "Somebody who left their name off a CV on purpose did not mean 'except in the file's properties'" (templates/documents/themes/base_cv.html:27-28). But document_title() always leads with the holder's full name, and that title is used everywhere a document is named on its way out. The wiki (CVs.md) offers the switch "for an anonymised copy", so a person relying on it sends their name all the same.

  • Where:
    • documents/rendering.py:55-67, document_title: "%(name)s — %(kind)s" from document_holder(), with no regard for show_contact_details.
    • It becomes the HTML <title> (base_cv.html:26, base_portfolio.html:24), which the PDF renderer writes as /Title; the snapshot's title and file name (rendering.py:656-679, f"{slugify(title) or 'cv'}.pdf"), and RenderedDocument.download_name (documents/models.py:688); draft_name (rendering.py:578-586), used for the draft PDF's name (documents/views.py:135); and cv_outline(...).title (rendering.py:406), used for the .txt/.docx download name (documents/views.py:432) and the DOCX <dc:title> (documents/docx.py:250).
    • tests/test_pdf_render.py:201-205, test_a_cv_with_its_contact_block_off_names_nobody_in_the_file, checks only /Author.
  • What happens: with show_contact_details=False for Alex Morgan, the rendered HTML has no author meta and no name in the body, but <title> is "Alex Morgan — CV", draft_name is "Alex Morgan — CV (draft)" and the outline title is "Alex Morgan — CV". A recruiter opening the PDF sees the name in the viewer's title bar, and the uploaded file is called alex-morgan-cv.pdf.
  • Why it matters: name-blind recruitment (anonymous CVs in public-sector and some private hiring) is the case the switch is documented for, and the name is defeated by the file's own title and name, which the person never sees in the preview.
  • Fix: give document_title the CV's choice: when show_contact_details is off, leave the holder out and title the document by its kind (or by the headline the page prints as its h1). Every caller above then follows. Related to #223, which moved the title from the variant name to "holder — kind" and did not consider the anonymous case; #308 (open) will widen the contact choice and should keep this rule.

Done when

  • The test in tests/test_pdf_render.py also asserts that the holder's name is absent from /Title, from rendering.draft_name(cv), from cv_outline(cv).title and from the snapshot's file name when show_contact_details is off; it fails today.
Found on 2026-09-29 in a read-only review of postulo at 95348908d, by reading how a CV's title is built and rendering a CV with its contact block off. Checked again on 2026-10-01 against `main` at `0a5cad587`: still present. The code is now at `documents/rendering.py:62-74` (`document_title`), `documents/rendering.py:630-653` (the snapshot's title and file name), `documents/rendering.py:552-560` (`draft_name`), `documents/rendering.py:380` (the title `cv_outline` gives) and `documents/models.py:716` (`RenderedDocument.download_name`); the themes, `documents/views.py`, `documents/docx.py:250` and the test have not moved. Unticking *include contact details* takes the name off the page and out of the PDF's `/Author`, and the theme says why: "Somebody who left their name off a CV on purpose did not mean 'except in the file's properties'" (`templates/documents/themes/base_cv.html:27-28`). But `document_title()` always leads with the holder's full name, and that title is used everywhere a document is named on its way out. The wiki (`CVs.md`) offers the switch "for an anonymised copy", so a person relying on it sends their name all the same. - **Where:** - `documents/rendering.py:55-67`, `document_title`: `"%(name)s — %(kind)s"` from `document_holder()`, with no regard for `show_contact_details`. - It becomes the HTML `<title>` (`base_cv.html:26`, `base_portfolio.html:24`), which the PDF renderer writes as `/Title`; the snapshot's `title` and file name (`rendering.py:656-679`, `f"{slugify(title) or 'cv'}.pdf"`), and `RenderedDocument.download_name` (`documents/models.py:688`); `draft_name` (`rendering.py:578-586`), used for the draft PDF's name (`documents/views.py:135`); and `cv_outline(...).title` (`rendering.py:406`), used for the `.txt`/`.docx` download name (`documents/views.py:432`) and the DOCX `<dc:title>` (`documents/docx.py:250`). - `tests/test_pdf_render.py:201-205`, `test_a_cv_with_its_contact_block_off_names_nobody_in_the_file`, checks only `/Author`. - **What happens:** with `show_contact_details=False` for Alex Morgan, the rendered HTML has no author meta and no name in the body, but `<title>` is "Alex Morgan — CV", `draft_name` is "Alex Morgan — CV (draft)" and the outline title is "Alex Morgan — CV". A recruiter opening the PDF sees the name in the viewer's title bar, and the uploaded file is called `alex-morgan-cv.pdf`. - **Why it matters:** name-blind recruitment (anonymous CVs in public-sector and some private hiring) is the case the switch is documented for, and the name is defeated by the file's own title and name, which the person never sees in the preview. - **Fix:** give `document_title` the CV's choice: when `show_contact_details` is off, leave the holder out and title the document by its kind (or by the headline the page prints as its `h1`). Every caller above then follows. Related to #223, which moved the title from the variant name to "holder — kind" and did not consider the anonymous case; #308 (open) will widen the contact choice and should keep this rule. ## Done when - The test in `tests/test_pdf_render.py` also asserts that the holder's name is absent from `/Title`, from `rendering.draft_name(cv)`, from `cv_outline(cv).title` and from the snapshot's file name when `show_contact_details` is off; it fails today.
tiagoagueda added this to the 0.5.0 milestone 2026-10-01 10:47:12 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Postulo/postulo#512
No description provided.