Skip to content

FEATURE: Bulk suspend users and filter the admin users list by activation#41227

Merged
ZogStriP merged 1 commit into
mainfrom
admin-users-bulk-suspend
Jun 29, 2026
Merged

FEATURE: Bulk suspend users and filter the admin users list by activation#41227
ZogStriP merged 1 commit into
mainfrom
admin-users-bulk-suspend

Conversation

@ZogStriP

Copy link
Copy Markdown
Member
  • Adds an activation filter (All / Activated / Not activated) to the Admin > Users > New tab so unverified accounts can be isolated in the UI.
  • Adds a bulk suspend action next to the existing bulk delete, plus a "Select all" / "Clear all" control so a whole page of accounts can be actioned at once.
  • Shows the suspend reason on the Suspended tab, mirroring the silenced tab.

Already-suspended users are excluded from bulk suspension, and the penalty-reason columns are populated from a single batched query instead of one query per row.

SCREENSHOTS

desktop-horizon-light-admin-users-activation-filter desktop-horizon-light-admin-users-bulk-select desktop-horizon-light-admin-users-suspended desktop-horizon-light-admin-users-bulk-suspend

@github-actions github-actions Bot added the i18n PRs which update English locale files or i18n related code label Jun 26, 2026

@pmusaraj pmusaraj left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

def fetch_users(params:)
# this order clause ensures we retrieve the users in the same order as the
# IDs in the param. we do this to ensure the users are suspended in the same
# order as they're selected in the UI

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just curious, is the order of selection important?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not for correctness — users are suspended independently, so the outcome is the same in any order. It only keeps the progress feed (the position/total we publish to /bulk-user-suspend) counting up in the same order they're selected in the UI rather than in PK order. Mirrors what User::BulkDestroy already does.

…tion

Communities periodically get hit by waves of spam registrations. Because
these accounts have not verified their email they cannot post, but staff
still need to review them and decide whether to suspend or delete them.
Until now the only way to surface them was a Data Explorer query, after
which each account had to be actioned individually in the admin UI, which
is tedious for large waves.

This fills the gaps in that cleanup workflow:

- Adds an activation filter (All / Activated / Not activated) to the
  Admin > Users > New tab so unverified accounts can be isolated in the UI.
- Adds a bulk suspend action next to the existing bulk delete, plus a
  "Select all" / "Clear all" control so a whole page of accounts can be
  actioned at once.
- Shows the suspend reason on the Suspended tab, mirroring the silenced tab.

Already-suspended users are excluded from bulk suspension, and the
penalty-reason columns are populated from a single batched query instead of
one query per row.
@ZogStriP ZogStriP force-pushed the admin-users-bulk-suspend branch from a6797f1 to 210f38b Compare June 29, 2026 09:12
@ZogStriP ZogStriP merged commit a1ebd19 into main Jun 29, 2026
17 checks passed
@ZogStriP ZogStriP deleted the admin-users-bulk-suspend branch June 29, 2026 09:26
@discoursebot

Copy link
Copy Markdown
Contributor

This pull request has been mentioned on Discourse Meta. There might be relevant details there:

https://meta.discourse.org/t/review-and-suspend-accounts-which-are-not-yet-activated/406639/1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

i18n PRs which update English locale files or i18n related code

Development

Successfully merging this pull request may close these issues.

3 participants