Dead code: eighteen unreferenced definitions and an orphaned posting form, several of them traps for whoever finds them #401
Labels
No labels
accessibility
authentication
breaking change
bug
documentation
enhancement
interface
internationalisation
observability
performance
security
tier
1
tier
2
tier
3
tier/4
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Postulo/postulo#401
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Found on 2026-09-29 in a read-only review of postulo at
95348908d, searching every snapshot repository (postulo, the plugins, the extensions, postulo-mcp, postulo-templates and the wiki; source, tests, templates and static files) for each name.Checked again on 2026-10-01 against
mainat0a5cad587: still present. The code is now atdocuments/kinds.py:136-138(authored_choices),resume/translatable.py:50-51(may_translate),applications/agenda.py:163-165(Event.local_end),documents/models.py:318-325(CVItem.highlight_lines) anddocuments/models.py:195-197(CV_THEMES),documents/rendering.py:100-112(Entry.highlight_lines, read at:282and:294; the entry put into the CV's language at:143-144,cvin the theme context at:228),core/mail.py:24-26(CONVENTIONAL_PORTS),core/mail.py:32(DEFAULT_MAIL_PORTS) andcore/mail.py:43-66(_mismatch),tests/test_width.py:64and:69, andtests/e2e/test_accessibility.py:479and:539; the other locations have not moved.Each definition below is referenced nowhere but its own line (
may_translatealso in the list that re-exports it). Most are harmless leftovers. Five are worse than dead: three carry comments describing a job they no longer do, one is a second rule for an unanswered application that disagrees with the one every page uses, and one shares its name with the property CV themes are told to read but answers in the wrong language. A whole view also survives for a page nothing links to.1. Unreferenced definitions
api/views.py:69token_list_urlapplications/analytics.py:622-629has_enough_historyapplications/quiet.py:150-155quiet_byapplications/services.py:546LATER_CHOICEScore/backup.py:574-578as_dictcore/messages_tool.py:192-197owner_ofdocuments/kinds.py:117-119authored_choices(Kind.authoreditself stays: the registry entries set it)resume/translatable.py:50-51may_translate: #248 moved it out ofresume/translating.py, which now names it in its re-export list (resume/translating.py:54). Nothing calls it under either module.core/models.py:475-481PhoneNumber.forget_verification:PhoneNumber.save()(core/models.py:369) already clearsverified_atandis_recoverywhen the number changes, so this has no caller and no job.applications/agenda.py:147-149Event.local_end,applications/endings.py:58-60status_label,applications/models.py:895-897Suggestion.is_matched,applications/reports.py:366-367Tally.share_of: properties and methods whose names occur once in the whole corpus, templates included. (Event.is_span, besidelocal_end, is read by one test only,tests/test_calendar.py:90.)2. Unreferenced, and misleading
applications/analytics.py:611-619applications_needing_a_nudge: "Applications that were sent, never answered, and are getting old", decided by a fixed 14 days andAPPLIEDorACKNOWLEDGEDonly.applications/quiet.py:11-12says "Everything that shows or counts quiet applications uses the one predicate here, so the dashboard, the board, the table, the figures and the notifier all agree"; this is a second predicate beside it, which ignores the person's own threshold (threshold_for), the reminders already set and the interviews not yet held.documents/models.py:278-285CVItem.highlight_lines: the shipped themes readentry.highlight_linesonrendering.Entry(documents/rendering.py:126-138;templates/documents/themes/base_cv.html:121,base_portfolio.html:74;documents/rendering.py:308and:320), and thehighlight_linesintemplates/resume/overview.htmlandpreview.htmlis the career item's own (resume/models.py:60). Nothing reads the one onCVItem. The two bodies are the same code, butEntry.itemis the entry already put into the CV's language (documents/rendering.py:169-170, #131), whileCVItem.itemis the master copy.applications/tables.py:112-113STATUSES: "Offered by the status filter above the table", but the filter context passesStatus.choicesitself (applications/views.py:122).core/mail.py:21-23CONVENTIONAL_PORTS: "Used only to explain a failure", but_mismatch(core/mail.py:53-76) hard-codes 465 and(587, 25). The port facts now exist three times: here, inDEFAULT_MAIL_PORTS(core/mail.py:42) and in_mismatch.documents/models.py:155-157CV_THEMES: "A portfolio leads with the work, so it gets the theme written for that", but both kinds map to"plain"and nothing reads it.3. An orphaned page
jobs/views.py:893-906PostingCreateViewandjobs/urls.py:94(jobs:posting_create,/jobs/postings/new/). #25 noted that it "is linked from no template"; the Listings page has since gained its own Add a listing,listings:create(jobs/listing_urls.py:9,ListingCreateView,jobs/listing_views.py:201-227), andjobs:posting_createis still reversed nowhere: no template, Python module, script, wiki page or sibling repository names it. Onlytests/test_width.py:63andtests/e2e/test_accessibility.py:476and:536visit the address.The two views have already drifted.
ListingCreateViewusesPostingIntakeForm, finds or makes the company by name throughget_or_create_company, and creates throughapplications.services.create_listing.PostingCreateViewusesJobPostingForm, a company chosen from a list, a plain model save, and a?company=pre-fill of its own (jobs/views.py:898-906) that passes the raw value tofilter(pk=...), so a non-numeric value raises instead of being ignored.Why it matters:
applications_needing_a_nudgeby name shows a list that disagrees with the Gone quiet widget, the board and the notifier.cvas well assections(documents/rendering.py:254), so a plugin theme that walkscv.itemsand reaches forcv_item.highlight_linesprints a French CV's highlights in the master language.STATUSESexpecting the filter to follow, editsCONVENTIONAL_PORTSexpecting the mail errors to follow, readsCV_THEMESto learn a portfolio's default) and nothing changes.Fix:
may_translateout of the re-export inresume/translating.py. If a list of applications to chase is wanted later, build it onApplicationQuerySet.quiet()orquiet.quiet_applications.Entry.highlight_lines, the nameEntry's docstring gives to themes, becomes the only one there is._mismatchread its ports fromDEFAULT_MAIL_PORTSrather than keeping a third copy.PostingCreateViewand its route, or turnpostings/new/into a redirect tolistings:create(which takes no?company=, so the parameter is dropped). Take/jobs/postings/new/out oftests/test_width.py:63andtests/e2e/test_accessibility.py:476and:536; the listing form is already in both (tests/test_width.py:68,tests/e2e/test_accessibility.py:449), so add/listings/new/only to the list at:536if that list should keep a listing form.templates/jobs/posting_form.htmlstays, sincePostingUpdateViewuses it (jobs/views.py:886).Done when
src/ortests/(forhighlight_lines, nothing onCVItem), and the suite passes with no other change;tests/test_career_languages.pyandtests/test_document_themes.pyin particular still pass.tests/test_listings.py(or beside the existing listing tests) asserts thatreverse("jobs:posting_create")raisesNoReverseMatch, or that/jobs/postings/new/redirects tolistings:create.tests/test_width.pyandtests/e2e/test_accessibility.pyno longer name/jobs/postings/new/.