Can't seem to approve users?

AI-generated summary

The discussion revolves around an issue with approving users in Discourse. canyon289 initially reported being unable to approve users due to an internal server error, which was linked to a Reviewable::InvalidAction error in the logs.

After researching, canyon289 found a workaround by deactivating and then reactivating the user, allowing for approval. This led to creating a script to automate the process for all users, as they had imported from vBulletin 3.

The issue was later confirmed to be fixed in a commit by techAPJ, with the solution available on GitHub.

Hi,
I’m looking to bulk approve users, but am running into issues even approving one user through the UI. The button looks “greyed out” and when I press approve I get an internal server error.

I’m on version 2.5.0.beta3, commit hash 0e4db91870

Inspecting the logs I get

Reviewable::InvalidAction (Can't peform `approve_user` on ReviewableUser) /var/www/discourse/app/models/reviewable.rb:346:in `perform' 

While the log message is clear I’m not sure what the correct user action is for me to approve this user.

Here’s what I get in the firefox console

Here’s what my UI looks like

Once this is resolved I would like to bulk approve users in a manner that they all get the associated emails.
If I do a bulk update as shown below (and in this thread Bulk deleting / mass modifying users) will that ensure they get emails?

If so what would the equivalent command be? (Similar to the one below)

User.joins(:user_stat).where("user_stats.post_count = 0 AND user_stats.topic_count = 0").destroy_all

Thank you in advance for any help!

Continued doing research and I found this thread. However I don’t have anything in my review queue, and the user seems to be activated already

Another update, if I deactivate the user, then click activate, I can then approve the user. Why is this?

Last update. In short I had to deactivate each user, activate each user, then approve. I imported from vbulletin 3 so not sure if I put my discourse instance in a bad state.

I wrote a script that hits the api in a loop over all users to do so. It’s running right now but will post here when its done.

Hi,

Do you have some news about it ?

Fixed in

https://github.com/discourse/discourse/commit/a78c64db351431bae1e74d03c097c25b23fa4af8