Portfolio: a current role or course prints only its start year, as if it had ended that year #515

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

Found on 2026-09-29 in a read-only review of postulo at 95348908d, reading the portfolio theme and the plain-text rendering of the same sections.

Checked again on 2026-10-01 against main at 0a5cad587: still present. The code is now at documents/rendering.py:259-260 (_period(..., years_only=True)), called from _section_blocks at documents/rendering.py:345; the two theme templates and resume/models.py:77-79 have not moved.

A portfolio sets experience and education one line each, with years only. When an entry has no end date, which the form asks for a current role ("Leave empty if this is your current role.", resume/models.py:77-79), the line prints the start year alone: no dash and no "present". The same template's project entries (base_portfolio.html:66-69) and the CV theme (base_cv.html:115) both print "– present" for an open end, and so does _period when it is not asked for years only.

  • Where: templates/documents/themes/base_portfolio.html:135-139 (the background list; the classic and plain portfolios extend it and do not override it), and documents/rendering.py:285-286 (_period(..., years_only=True), used by _section_blocks at documents/rendering.py:371 for the portfolio's text and DOCX).
  • What happens: a person whose current job started in 2020 exports or sends a portfolio. The background line reads "Senior Engineer Acme 2020" in the PDF and "Senior Engineer · Acme · 2020" in the text and DOCX; the same entry on their CV reads "March 2020 – present".
  • Why it matters: an employer reads the portfolio as saying the person held the role only during 2020, which is the opposite of what they entered.
  • Fix: in base_portfolio.html, add the open-ended branch the project entries already have: {% if entry.item.end_date %}…{% elif entry.item.start_date %} – {% translate "present" %}{% endif %}. In _period, when years_only and there is a start but no end, return f"{start.year} – {gettext('present')}", so that the text and the page still say the same line.

Done when

  • A test in tests/test_page_rendering.py renders a portfolio with an experience that has a start date and no end date, and asserts that both the rendered HTML and the portfolio's text outline contain the start year followed by "present".
Found on 2026-09-29 in a read-only review of postulo at 95348908d, reading the portfolio theme and the plain-text rendering of the same sections. Checked again on 2026-10-01 against `main` at `0a5cad587`: still present. The code is now at `documents/rendering.py:259-260` (`_period(..., years_only=True)`), called from `_section_blocks` at `documents/rendering.py:345`; the two theme templates and `resume/models.py:77-79` have not moved. A portfolio sets experience and education one line each, with years only. When an entry has no end date, which the form asks for a current role ("Leave empty if this is your current role.", `resume/models.py:77-79`), the line prints the start year alone: no dash and no "present". The same template's project entries (`base_portfolio.html:66-69`) and the CV theme (`base_cv.html:115`) both print "– present" for an open end, and so does `_period` when it is not asked for years only. - **Where:** `templates/documents/themes/base_portfolio.html:135-139` (the `background` list; the `classic` and `plain` portfolios extend it and do not override it), and `documents/rendering.py:285-286` (`_period(..., years_only=True)`, used by `_section_blocks` at `documents/rendering.py:371` for the portfolio's text and DOCX). - **What happens:** a person whose current job started in 2020 exports or sends a portfolio. The background line reads "Senior Engineer Acme 2020" in the PDF and "Senior Engineer · Acme · 2020" in the text and DOCX; the same entry on their CV reads "March 2020 – present". - **Why it matters:** an employer reads the portfolio as saying the person held the role only during 2020, which is the opposite of what they entered. - **Fix:** in `base_portfolio.html`, add the open-ended branch the project entries already have: `{% if entry.item.end_date %}…{% elif entry.item.start_date %} – {% translate "present" %}{% endif %}`. In `_period`, when `years_only` and there is a start but no end, return `f"{start.year} – {gettext('present')}"`, so that the text and the page still say the same line. ## Done when - A test in `tests/test_page_rendering.py` renders a portfolio with an experience that has a start date and no end date, and asserts that both the rendered HTML and the portfolio's text outline contain the start year followed by "present".
tiagoagueda added this to the 0.6.0 milestone 2026-10-01 10:47:14 +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#515
No description provided.