mirror of
https://github.com/discourse/discourse.git
synced 2026-08-05 16:23:34 +08:00
Previously, suspect-user reviewables ("user needs approval" flags) and
queued-post reviewables could only be resolved by deleting the user or
rejecting the post outright — a reviewer mistake on an automated false
positive was irreversible, and sites with no-deletion policies had to
resolve the flag and then manually suspend the user from their admin
page. Requested in [meta t/408891](https://meta.discourse.org/t/408891)
and [meta t/225660](https://meta.discourse.org/t/225660).
This change adds guardian-gated **Silence user** / **Suspend user**
resolutions to both queues via a shared `build_penalty_actions` helper,
using the same penalize-modal flow the flagged-post and
review-every-post queues already use (staff log linked back to the
reviewable). Along the way it:
- hides penalty actions that are already active everywhere (previously a
resolve-then-409 dead end), and fixes the penalize modal's unawaited
`before()` race so the penalty is only applied once the reviewable
action succeeded;
- narrows the rejected-user **scrub** affordance to records whose
identity snapshot is the last remaining copy (user deleted, or
renamed/anonymized after a failed deletion), admin-gated to match the
endpoint;
- shows an active penalty (localized end date and reason) on the
reviewable user card, so it's clear why a penalty option is absent;
- preloads `anonymous_user_master` on the queue since the new
`silenced?` gates would otherwise lazy-load it per row;
- rewrites the action descriptions in one consistent voice.
<img width="460" height="313" alt="2026-07-31 @ 07 46 57"
src="https://github.com/user-attachments/assets/87d5bf49-97e0-47a4-939e-16da3f55c6e1"
/>
|
||
|---|---|---|
| .. | ||
| reports | ||
| acl_target.rb | ||
| anon_cache_invalidator.rb | ||
| cached_counting.rb | ||
| category_hashtag.rb | ||
| custom_field.rb | ||
| has_cooked_tag_description.rb | ||
| has_custom_fields.rb | ||
| has_deprecated_columns.rb | ||
| has_destroyed_web_hook.rb | ||
| has_nested_reply_stats.rb | ||
| has_post_upload_references.rb | ||
| has_sanitizable_fields.rb | ||
| has_search_data.rb | ||
| has_url.rb | ||
| limited_edit.rb | ||
| locale_matchable.rb | ||
| localizable.rb | ||
| positionable.rb | ||
| reviewable_action_builder.rb | ||
| roleable.rb | ||
| searchable.rb | ||
| second_factor_manager.rb | ||
| stats_cacheable.rb | ||
| topic_tracking_state_publishable.rb | ||
| trashable.rb | ||