Search: the \"All N in …\" links drop or mangle the query, so they rarely open the N results they promise #506
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#506
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, reading how search builds its per-group links and comparing them with the list pages they open.Checked again on 2026-10-01 against
mainat0a5cad587: still present. The code is now atcore/search.py:560-562(more_urlinsearch) andcore/search.py:532-543(GROUPS); the other locations have not moved. Since #316 the Reminders group links to the calendar's agenda narrowed to reminders (_reminders_address,core/search.py:522-525), still without the query.When a search group has more than five hits, the results page offers "All N in ". The link is built in three ways that each break the promise in its text.
core/search.py:547-549,search(more_url = f"{more_url}?q={query}");core/search.py:519-530,GROUPS, where eight of the ten groups settakes_querytoFalse;templates/core/search.html:60-67, the link;applications/views.py:88-94,ApplicationFilterMixin.filter_queryset;jobs/views.py:95-102, the companies list'sq.1. The query is not encoded
more_urlpastes the cleaned query into the address as it is. A query holding&,#,+or%changes what the target receives: forR&Dthe link is/jobs/companies/?q=R&D, so the companies page readsq=Rand a stray emptyD. A#starts a fragment, a+becomes a space. The page then narrows by something the person did not type.2. Eight groups link to an unfiltered list
Listings, People, Reminders, Text you sent, Letters, CVs, Files and Career record link to their list with no query. "All 48 in Listings" opens every listing.
3. The two that pass
qfilter different fieldsThe applications list matches
posting__title,posting__company__nameandposting__location; search matches title, company name and the timeline'ssummaryandbody. The companies list matches name, location, industry and identifier; search also matchesnotesandwebsite. A phrase found only in timeline notes or company notes gives "All 12 in Applications" and an empty table.urlencode({"q": query}). For a group whose list cannot take the query, drop the "All N" link or point it at the search page with akind=parameter that lists the whole group, paged; search already computes it. Make theqfilters of the applications and companies lists match the fieldssearch_applicationsandsearch_companiesuse (moving both onto those functions' conditions), or word the link so it does not promise N.Related to #313 (open), which changes the header's search box but not these links.
Done when
tests/test_search.pyhas tests that a query containing&and#round-trips throughmore_urlunchanged, that no group's link opens a list unfiltered while promising N, and that the number of rows on the linked applications page equals the group'stotalfor a query that matches only timeline text.