Skip to content

Admin Users: persist requested storage, rename and regroup filters, add clear action - #6096

Draft
akolson wants to merge 2 commits into
learningequality:hotfixesfrom
akolson:add-requested-storage-value
Draft

Admin Users: persist requested storage, rename and regroup filters, add clear action#6096
akolson wants to merge 2 commits into
learningequality:hotfixesfrom
akolson:add-requested-storage-value

Conversation

@akolson

@akolson akolson commented Aug 18, 2026

Copy link
Copy Markdown
Member

Summary

This fixes QA follow-ups from #5946, all on the admin Users page.

  • Requested storage never reached the "Storage needed" column. information["space_needed"] is only written at registration, and only when the user ticks "Storing materials for private or local use" — the post-registration storage request flow just sent an email and persisted nothing. So users who requested storage after signing up showed blank, while older users who answered the registration question showed a value. StorageSettingsView now records the requested amount on the user, and the CSV prefers it over the registration answer. No migration: information is an existing JSONField.
  • "Has Studio edits" was misnamed. The filter is Exists(Change.objects.filter(created_by=...)), which matches any Change row the user ever created — creating a channel qualifies, and deleting it later doesn't undo it. That is activity, not edits, which is what QA observed. Renamed in the filter row and the CSV header; the query param and backend annotation are unchanged, so existing bookmarked URLs still work.
  • The two checkboxes sat in separate quarter-width columns, leaving the wide gap in QA's screenshot. They now share one half-width flex row with a "Clear filters" action at the end.
  • Clear filters removes every filter while preserving pagination and sorting. It is enabled only once a filter differs from the default its control already displays — so choosing "All" for user type enables it (the select is blank until you pick something), while "Any time" on the date windows, or ticking and unticking a checkbox, does not.
users-all-enabled users-all-selected

References

Fixes #5946

Reviewer guidance

Manually verified against a local devserver at 1600px and 820px, signed in as an admin: the renamed label, the two checkboxes now adjacent, "Clear filters" greyed out on a clean page, enabled after selecting "All", and the row wrapping cleanly at the narrow width. Screenshots to follow in a comment.

AI usage

Used Claude Code throughout, in a plan-then-review loop. I had it trace the root cause of the empty "Storage needed" column before proposing anything, and rejected its first design, which stored a requested_on timestamp nothing would read. I also caught that its clear-filters logic left the action disabled after selecting "All"; the fix was to compare each filter against the default its control already shows rather than against the params sent to the backend. Its first attempt at that comparison marked a clean page as filtered — the existing test suite caught it. I reviewed every diff, ran the frontend and backend suites and the linter, and verified the layout in a browser.

akolson and others added 2 commits August 18, 2026 17:21
A storage request only ever sent an email, so the admin Users CSV
"Storage needed" column could only show what a user typed at
registration. Users who requested storage afterwards showed blank.

Persist the requested amount to user.information and prefer it over the
registration answer when building the CSV row.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
"Has Studio edits" matched any Change row the user ever created, so it
reported activity rather than edits; renamed to "Has Studio activity" in
the filter row and the CSV header.

On wide viewports the two checkboxes sat in separate quarter-width
columns, leaving a large gap between them. They now share one half-width
flex row alongside a "Clear filters" action, which resets every filter
while preserving pagination and sorting. The action is enabled only once
a filter differs from the default its control already displays.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant