discourse/spec/initializers
Régis Hanol ed9669e680
FIX: Approve users stuck with a non-pending ReviewableUser (#40303)
Previously, clicking Approve on a user's admin profile 500'd with
`Reviewable::InvalidAction` when that user had a non-pending
`ReviewableUser` (e.g., after `UserDestroyer.destroy` was rescued
because the user had posts), and toggling on `must_approve_users` also
skipped those users — leaving them permanently un-approvable from the
admin UI.

This change gates the `:approve_user` action on
`guardian.can_approve?(target)` instead of `status == "pending"`, fixes
the auto-approval initializer to only skip users with a *pending*
reviewable, and centralizes `updatable_reviewable_scores` so re-approval
correctly flips `disagreed` scores back to `agreed`.

https://meta.discourse.org/t/403620

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-27 16:38:01 +02:00
..
000_pg_connection_patch_spec.rb DEV: Patch ActiveRecord's postgresql adapter .new_client (#33820) 2025-09-18 11:34:37 +08:00
content_localization_setting_spec.rb FEATURE: Automatically add 'Add Translation' post menu when content localization enabled (#36210) 2025-11-25 14:41:00 +08:00
custom_timezones_spec.rb
track_setting_changes_spec.rb FIX: Approve users stuck with a non-pending ReviewableUser (#40303) 2026-05-27 16:38:01 +02:00
web_hook_events_spec.rb Add user_anonymized webhook event (#36208) 2025-11-25 07:43:16 -08:00