Repository navigation
Fix CfP review messages sort links when not filtering - #2394
Open
Anthony-Sin wants to merge 1 commit into
Open
Anthony-Sin wants to merge 1 commit into
Anthony-Sin wants to merge 1 commit into
Conversation
When no type filter is applied the messages view passes type='all' to the template, which then injects type=all into every sort link. Any sorted view then filters proposals on Proposal.type == 'all' and shows no rows. Treat type=all as unfiltered in the view and drop the type parameter from the template's sort and unread links when it is 'all'. Adds regression tests covering both directions. Fixes emfcamp#1752
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1752
What this changes
The "all messages" page at
/admin/cfp-review/messagesrenders one table row per proposal with messages, and its column headers are sort links. With no type filter applied the view setsfilter_type = "all", so every sort link rendered bymessages.htmlcarriedtype=all. Following any of them appliedProposal.type == "all"to the query, which matches nothing — sorting an unfiltered table emptied it.Two small changes:
apps/cfp_review/base.py: the view now treatstype=allthe same as a missingtypeparameter, so a stale or hand-typedtype=allURL no longer filters every row out.templates/cfp_review/messages.html: sort and "unread first" links useqs_type, which isnonewhen the page is unfiltered, so the links no longer injecttype=allinto the query string at all.Also adds
tests/cfp_review/test_messages_sort.pywith two regression tests: sorting withtype=allstill returns all proposals with messages, and the rendered sort links no longer containtype=all.Evidence
Before (test client, seeded with a talk and a workshop proposal that each have a message):
After the fix, the new tests pass:
Checks run:
ruff format --checkandruff checkclean,mypyreports "Success: no issues found in 183 source files". The pytest suite passes fortests/cfp_reviewandtests/content(13 passed, 14 skipped). In the full suite,tests/volunteer/test_role.py::test_grouped_by_teamfails identically on unmodifiedmain, so it is unrelated to this change.AI disclosure
I work on this as part of a university open-source contribution course and use Claude Code (Anthropic) in my development workflow: it helped me locate the filtering code, draft the regression tests, and format this description. I reproduced the issue, chose the fix, and ran all tests myself; I reviewed the full diff before opening this PR.