# "136 / 137 user waiting for approval"

**URL:** https://meta.discourse.org/t/136-137-user-waiting-for-approval/326850
**Category:** Support
**Created:** [September 17, 2024, 11:42am UTC](https://meta.discourse.org/t/136-137-user-waiting-for-approval/326850 "2024-09-17T11:42:36Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![ganncamp](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ganncamp/32/106199_2.png) [@ganncamp](https://meta.discourse.org/u/ganncamp)
#### Post date: [September 17, 2024, 11:42am UTC](https://meta.discourse.org/t/136-137-user-waiting-for-approval/326850/1 "2024-09-17T11:42:36Z")

</div>

No matter _how many_ users are in the review queue, if there are _any_ users in the queue, I get a message that always (yes _always_) says there are either 136 users or 137 users in the queue. Every. Single. Time.

How do we fix this?

 ![Selection_2023](https://global.discourse-cdn.com/meta/original/4X/5/7/3/57396cd95c9cbae9afcd3c16e4d78419e527da97.png)

 ![Selection_2024](https://global.discourse-cdn.com/meta/original/4X/d/a/1/da121648a9a2fc8b3195dda500b658335315739f.png)

---

<div class="post-metadata">

### Author: ![Moin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/moin/32/554653_2.png) [@Moin](https://meta.discourse.org/u/Moin)
#### Post date: [September 17, 2024, 12:07pm UTC](https://meta.discourse.org/t/136-137-user-waiting-for-approval/326850/2 "2024-09-17T12:07:29Z")

</div>

I get those messages too. When I enabled approval, not all existing users were automatically approved. (["must approve users" notifications are incorrectly triggered by old users - #4 by Moin](https://meta.discourse.org/t/must-approve-users-notifications-are-incorrectly-triggered-by-old-users/240731/4)). So I could find them with [Data Explorer](https://meta.discourse.org/t/32566?silent=true) and approve them manually from their profile admin page. (But 136 are a lot for manual approval!)

There are also these bug reports:

> [@Notification claims X users for approval, but none are found](https://meta.discourse.org/t/topic/262853/9):
>
> I found this topic while searching before filing a bug report, so adding to it. TL;DR the query for the notification is wrong because it counts rejected users as well. Notification: 16 users waiting for approval, click the link, see only 2. The [query used for the notification](https://github.com/discourse/discourse/blob/fcafc8872fe76158064a58fc58bc70b34a279c66/app/jobs/scheduled/pending_users_reminder.rb#L9) is this puts AdminUserIndexQuery.new(query: "pending", stats: false).find\_users\_query.to\_sql SELECT "users".\* FROM "users" WHERE (suspended\_till IS NULL OR suspended\_till \<= '2023-11-13 11:05:23.225614') AND "users".…

> [@Two users waiting for approval but not in RQ- where are they?](https://meta.discourse.org/t/topic/208854/):
>
> We use the same signup process for all new users, using Wordpress as the OAuth provider and requiring manual approval on Discourse. 99% of the time it works. But two users over the past weeks are hiding somewhere. Discourse sends notifications that they are pending approval, but there are not on the Review Queue, no matter how I filter. Discourse must know where they are, since it’s sending notifications. How can I find them? [image]

---

<div class="post-metadata">

### Author: ![ganncamp](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ganncamp/32/106199_2.png) [@ganncamp](https://meta.discourse.org/u/ganncamp)
#### Post date: [September 17, 2024, 1:12pm UTC](https://meta.discourse.org/t/136-137-user-waiting-for-approval/326850/3 "2024-09-17T13:12:09Z")

</div>

Thanks for those pointers @Moin.

With [this](https://meta.discourse.org/t/notification-claims-x-users-for-approval-but-none-are-found/262853/9)

```plaintext
SELECT "users".* FROM "users" 
WHERE (suspended_till IS NULL OR suspended_till <= '2023-11-13 11:05:23.225614') 
AND "users"."approved" = FALSE 
AND "users"."active" = TRUE 
ORDER BY users.created_at DESC,users.username

```

I get 135 records.

Choosing the oldest one somewhat at random, `samirbehara`, I come to [this user](https://community.sonarsource.com/u/samirbehara/activity), who has public activity.

On the admin side of his account, I have the option to “Approve”, but I don’t understand why.

 ![Selection_2025](https://global.discourse-cdn.com/meta/original/4X/1/d/c/1dca5c5f4c9d752bd68239bc80bfcf3001ec8f84.png)

---

<div class="post-metadata">

### Author: ![Colin\_Mueller](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/colin_mueller/32/220223_2.png) [@Colin\_Mueller](https://meta.discourse.org/u/Colin_Mueller)
#### Post date: [September 17, 2024, 1:15pm UTC](https://meta.discourse.org/t/136-137-user-waiting-for-approval/326850/4 "2024-09-17T13:15:37Z")

</div>

As I just told my dear colleague @ganncamp over Slack, I turned off these notifications on our instance this morning.

 ![The image shows a text-based interface with a blank space for inputting a question or message. (Captioned by AI)](https://global.discourse-cdn.com/meta/original/4X/e/f/4/ef418b9d80e89e72d4bbc2b9f19191cb58b2a7f0.png)

They really didn’t serve us any purpose.

And still, it’s weird that it showed us so many (130+) when the review queue was so clearly not at that count.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [September 17, 2024, 2:38pm UTC](https://meta.discourse.org/t/136-137-user-waiting-for-approval/326850/5 "2024-09-17T14:38:59Z")

</div>

I haven’t paid particularly close attention here, so I may be off base.

> [@ganncamp](#):
>
> On the admin side of his account, I have the option to “Approve”, but I don’t understand why.

I think that they joined and you subsequently turned on “must approve users”. They had already joined and been a user who could post, but then you later required approval, which you have not given. I think your options are to approve or delete all 135 of them either in the UX or in Rails.

---

<div class="post-metadata">

### Author: ![Firepup650](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/firepup650/32/465200_2.png) [@Firepup650](https://meta.discourse.org/u/Firepup650)
#### Post date: [September 17, 2024, 10:29pm UTC](https://meta.discourse.org/t/136-137-user-waiting-for-approval/326850/6 "2024-09-17T22:29:12Z")

</div>

> [@pfaffman](#):
>
> I think that they joined and you subsequently turned on “must approve users”.

Doesn’t that end up bulk approving the existing users?

> [@Invite-registrations for existing users?](https://meta.discourse.org/t/invite-registrations-for-existing-users/316279/7):
>
> When you enable `must approve users`, all existing users are approved automatically.
> 
> [discourse/config/initializers/014-track-setting-changes.rb at a564274ba277a834b8a3ab4c28b2c1022fd9521e · discourse/discourse · GitHub](https://github.com/discourse/discourse/blob/a564274ba277a834b8a3ab4c28b2c1022fd9521e/config/initializers/014-track-setting-changes.rb#L8-L16)
> 
> Maybe it works to temporarily enable that to use the automation to approve your users.

---

<div class="post-metadata">

### Author: ![Moin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/moin/32/554653_2.png) [@Moin](https://meta.discourse.org/u/Moin)
#### Post date: [September 17, 2024, 10:37pm UTC](https://meta.discourse.org/t/136-137-user-waiting-for-approval/326850/7 "2024-09-17T22:37:26Z")

</div>

Usually yes. But there is a [bug](https://meta.discourse.org/t/must-approve-users-notifications-are-incorrectly-triggered-by-old-users/240731/4), so for some users that doesn’t work.

---

<div class="post-metadata">

### Author: ![Firepup650](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/firepup650/32/465200_2.png) [@Firepup650](https://meta.discourse.org/u/Firepup650)
#### Post date: [September 17, 2024, 11:00pm UTC](https://meta.discourse.org/t/136-137-user-waiting-for-approval/326850/8 "2024-09-17T23:00:11Z")

</div>

That seems a bit odd, since (if I can SQL properly) ours seem to have User as some of their target types?

```sql
SELECT
  users.id as user_id, approved, target_type, target_id
FROM
  users
INNER JOIN reviewables ON users.id=reviewables.target_id
WHERE approved = false
ORDER BY user_id

```

| userid | approved | target\_type | target |
| --- | --- | --- | --- |
| 39 | false | User | 39 |
| 127 | false | Post | 127 |
| 276 | false | Post | 276 |
| 278 | false | Post | 278 |
| 328 | false | User | 328 |

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [September 17, 2024, 11:27pm UTC](https://meta.discourse.org/t/136-137-user-waiting-for-approval/326850/9 "2024-09-17T23:27:36Z")

</div>

> [@Firepup650](#):
>
> Doesn’t that end up bulk approving the existing users?

Isn’t this topic about the fact that it didn’t?

---

<div class="post-metadata">

### Author: ![Firepup650](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/firepup650/32/465200_2.png) [@Firepup650](https://meta.discourse.org/u/Firepup650)
#### Post date: [September 17, 2024, 11:48pm UTC](https://meta.discourse.org/t/136-137-user-waiting-for-approval/326850/10 "2024-09-17T23:48:08Z")

</div>

That’s on me, I skimmed a tad too much and missed that entirely I guess.
