"must approve users" notifications are incorrectly triggered by old users

During the past few weeks, certain problematic (banned) users have been creating accounts with offensive/inappropriate usernames. To prevent this, I have turned on the setting marked “Staff must approve all new user accounts before they are allowed to access the site.” and it does indeed require approval for all new accounts.

However, rather annoyingly, every few hours I am also notified of “users waiting for approval” for old users that joined months or even years ago, way before this setting was even activated.

image

Clicking on the notification I see:

There are new user signups waiting to be approved (or rejected) before they can access this forum. Please review them.

… but clicking on “Please review them” shows that there aren’t any:

There are no items to review.

Searching down the list admin/users/list/new, I see that some users are indeed listed as “not approved”. I can’t find any commonalities between these “not approved” users except the fact that all of them were created before the setting was toggled. Some of them have “primary email: Not verified”, while others are verified.

I tried to approve each one manually, but I need to scroll back several hundred “pages” and I don’t see an easy way to filter the list by “not approved”.

Is there a quick way to mark every single existing user as “approved”? Or at least prevent the notifications about these old users from being sent out?

1 Like

Are you still suffering from this?

In the end I bit the bullet and scrolled down the entire list of users (manually looking for ones that had “Approved: No”), then entered each one’s profile and approved them individually :sweat:

I noticed the same behaviour and I think I found out why this happens (not why thoses users do not appear in the review queue but why they were not approved at all):

As I understand the code[1] when you enable ‘must_approve_users’, most users who were created before the setting was enabled should be approved:

This worked for most of my users, but some were not marked as approved.

Data Explorer Query
SELECT
  id as UserID, approved
FROM
  users
ORDER BY id
UserID Approved
1 true
3 true
8 true
10 false
11 false
12 false
13 true

When you look at the reviewables table you can notice that users with a user ID matching the target ID of a chat message were not approved.

Data Explorer Query
SELECT id, target_id, target_type
FROM reviewables
ORDER BY target_id
id target_id target_type
6 9 ChatMessage
7 10 ChatMessage
8 11 ChatMessage
9 12 ChatMessage
1 2901 Post
2 2909 Post
5 2991 Post

I think it’s a bug that users aren’t approved when there is a matching target ID that has a target type different than ‘user’.


  1. I have hardly any programming skills ↩︎

1 Like