Add mandatory pagination and 3-char search minimum to FacilityUsernameViewSet#14823
Open
rtibblesbot wants to merge 2 commits into
Open
Add mandatory pagination and 3-char search minimum to FacilityUsernameViewSet#14823rtibblesbot wants to merge 2 commits into
rtibblesbot wants to merge 2 commits into
Conversation
…eViewSet Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
Build Artifacts
Smoke test screenshot |
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.
Plan: Add mandatory pagination (default 10, max 20) and a 3-character minimum search requirement to
FacilityUsernameViewSet, then update the sign-in page frontend to consume the new paginated response.Summary
Add mandatory pagination to
/api/auth/facilityusername/— default page size 10, capped at 20 — and rejectsearchparams shorter than 3 characters with a 400. The sign-in page is updated to read usernames fromdata.resultsand determine listing-view eligibility fromtotal_pagesrather thannum_users, so large facilities no longer transfer their full username list on facility selection.References
Closes #14820
Reviewer guidance
total_pages, notnum_users.FacilityUsernameViewSet.list()inkolibri/core/auth/api.py— the 400 short-search path bypasses DRF's normal filter pipeline; verify thatsuper().list()still runs filters correctly for ≥3-char searches.AI usage
Claude Code (autonomous agent mode) implemented this via TDD: wrote failing backend tests, implemented the
FacilityUsernamePaginationclass andlist()override, then wrote failing frontend tests and updatedSignInPageto consume the paginated response. I reviewed the plan before execution and the diff after.@rtibblesbot's comments are generated by an LLM, and should be evaluated accordingly
How was this generated?