Phuong_SuSu reported an issue where a user account appears in the review tab with no “approve” button, only a “delete account” option, despite being active. The system incorrectly shows the user was approved by “noone,” and the review notification count remains stuck at (1). eviltrout initially suggested toggling the must_approve_users setting, but Phuong_SuSu confirmed this had no effect. eviltrout then diagnosed the issue: the user’s associated reviewable record was never marked as approved. To fix it, they advised retrieving the reviewable ID from the URL (e.g., /review/1234) and running either Reviewable.find(1234).update_column(:status, 1) in the Rails console or the SQL equivalent UPDATE reviewables SET status = 1 WHERE id = 1234. Phuong_SuSu confirmed the fix worked using the Rails console and asked how to run the SQL command directly. eviltrout replied that if Discourse is installed via Docker, one can use rails dbconsole inside the container to access the database directly. The issue was resolved successfully, and Phuong_SuSu expressed gratitude.
A user may register while I switching approval options in admin settings.
Now I get a funny situation
Her account was actived, the system shows that she was also approved by (noone)
then her account keeps showing in the review tab with only… a delete account button.
And in the review notifications menu, I always got (1) there…
I enable or disable the that mode many times, the result is the same, no “approve” button could be found (although other users are normal, except this user)
I think I need to update in the database somewhere, do you have any suggestion?
Ah I think I understand the problem now. The user was created, but the associated reviewable record was not marked as approved.
To fix this you will need the id of the reviewable item. You can get this by clicking on the date on the reviewable item, and the url will look like /review/1234 - 1234 is the number you want.
Then you can open a rails console:
rails c
And type this:
Reviewable.find(1234).update_column(:status, 1)
If you find accessing the database easier, the query would be this:
A quick question, how to accessing database like the second command?
I used the “Data Explorer Plugin” but it seemed just query the database, cannot update it.