# Strange approvals list

**URL:** https://meta.discourse.org/t/strange-approvals-list/113305
**Category:** Bug
**Created:** [April 3, 2019, 6:50am UTC](https://meta.discourse.org/t/strange-approvals-list/113305 "2019-04-03T06:50:30Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![schungx](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/schungx/32/70989_2.png) [@schungx](https://meta.discourse.org/u/schungx)
#### Post date: [April 3, 2019, 6:50am UTC](https://meta.discourse.org/t/strange-approvals-list/113305/1 "2019-04-03T06:50:30Z")

</div>

![image](https://global.discourse-cdn.com/meta/original/3X/5/5/559029d391f36f34a6ade424cc867bed8e7c4604.png)

I’m not sure what I can do on this topic… There is no Accept or Reject button, but the topic is obviously empty…

The hamburger menu shows one pending:

 ![image](https://global.discourse-cdn.com/meta/original/3X/d/3/d3d9800df14af6a2ca5d8f45f1429df9613459fd.png)

---

<div class="post-metadata">

### Author: ![eviltrout](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eviltrout/32/5275_2.png) [@eviltrout](https://meta.discourse.org/u/eviltrout)
#### Post date: [April 3, 2019, 8:45pm UTC](https://meta.discourse.org/t/strange-approvals-list/113305/3 "2019-04-03T20:45:29Z")

</div>

Okay this led me to discover a couple of bugs, both of which are fixed here:

[https://github.com/discourse/discourse/commit/111a502231d6f46d1a85acb0cc1bff8c60c1a5e4](https://github.com/discourse/discourse/commit/111a502231d6f46d1a85acb0cc1bff8c60c1a5e4)

---

<div class="post-metadata">

### Author: ![schungx](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/schungx/32/70989_2.png) [@schungx](https://meta.discourse.org/u/schungx)
#### Post date: [April 4, 2019, 1:48am UTC](https://meta.discourse.org/t/strange-approvals-list/113305/6 "2019-04-04T01:48:57Z")

</div>

OK, how should I get rid of these phantom topics?

---

<div class="post-metadata">

### Author: ![schungx](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/schungx/32/70989_2.png) [@schungx](https://meta.discourse.org/u/schungx)
#### Post date: [April 4, 2019, 2:12am UTC](https://meta.discourse.org/t/strange-approvals-list/113305/7 "2019-04-04T02:12:58Z")

</div>

Rebuilding now shows these phantoms with additional fields:

 ![image](https://global.discourse-cdn.com/meta/original/3X/9/2/92b400b2187af738ce97e07bde4ecc2528c6086e.png)

But still no way to remove them…

---

<div class="post-metadata">

### Author: ![eviltrout](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eviltrout/32/5275_2.png) [@eviltrout](https://meta.discourse.org/u/eviltrout)
#### Post date: [April 4, 2019, 2:24pm UTC](https://meta.discourse.org/t/strange-approvals-list/113305/8 "2019-04-04T14:24:26Z")

</div>

Are you familiar with a rails console? You can clear them out with this command:

`ReviewableUser.pending.each { |ru| ru.destroy if ru.target.blank? }`

In plain english: if there are pending users where the user record is missing, delete them.

---

<div class="post-metadata">

### Author: ![schungx](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/schungx/32/70989_2.png) [@schungx](https://meta.discourse.org/u/schungx)
#### Post date: [April 5, 2019, 3:26am UTC](https://meta.discourse.org/t/strange-approvals-list/113305/9 "2019-04-05T03:26:53Z")

</div>

> [@eviltrout](#):
>
> `ReviewableUser.pending.each { |ru| ru.destroy if ru.target.blank? }`

OK, two of them failed to delete.

```plaintext
[#<ReviewableUser:0x0000559e07933e60
  id: 1355,
  type: "ReviewableUser",
  status: 0,
  created_by_id: -1,
  reviewable_by_moderator: true,
  reviewable_by_group_id: nil,
  claimed_by_id: nil,
  category_id: nil,
  topic_id: nil,
  score: 6.0,
  potential_spam: true,
  target_id: 1964,
  target_type: "User",
  target_created_by_id: nil,
  payload: {"name"=>nil, "email"=>nil, "username"=>nil},
  version: 0,
  latest_score: Wed, 03 Apr 2019 12:39:14 UTC +00:00,
  created_at: Wed, 03 Apr 2019 12:39:14 UTC +00:00,
  updated_at: Wed, 03 Apr 2019 12:39:14 UTC +00:00>,
 #<ReviewableUser:0x0000559e07933208
  id: 1356,
  type: "ReviewableUser",
  status: 0,
  created_by_id: -1,
  reviewable_by_moderator: true,
  reviewable_by_group_id: nil,
  claimed_by_id: nil,
  category_id: nil,
  topic_id: nil,
  score: 6.0,
  potential_spam: true,
  target_id: 1965,
  target_type: "User",
  target_created_by_id: nil,
  payload: {"name"=>nil, "email"=>nil, "username"=>nil},
  version: 0,
  latest_score: Wed, 03 Apr 2019 17:03:26 UTC +00:00,
  created_at: Wed, 03 Apr 2019 17:03:26 UTC +00:00,
  updated_at: Wed, 03 Apr 2019 17:03:26 UTC +00:00>]

```

`ru.target.blank?` is false?

---

<div class="post-metadata">

### Author: ![schungx](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/schungx/32/70989_2.png) [@schungx](https://meta.discourse.org/u/schungx)
#### Post date: [April 5, 2019, 4:56am UTC](https://meta.discourse.org/t/strange-approvals-list/113305/10 "2019-04-05T04:56:07Z")

</div>

Alright, I removed those two phantom’s by omitting `if ru.target.blank?`

Now the approvals list windows is clean.

Not sure if I’ve done some ReallyBadThing™ to the system though…

---

<div class="post-metadata">

### Author: ![eviltrout](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eviltrout/32/5275_2.png) [@eviltrout](https://meta.discourse.org/u/eviltrout)
#### Post date: [April 5, 2019, 1:15pm UTC](https://meta.discourse.org/t/strange-approvals-list/113305/11 "2019-04-05T13:15:48Z")

</div>

You might have deleted the history of some items, but nothing serious. Glad it all got fixed in the end.

---

<div class="post-metadata">

### Author: ![eviltrout](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eviltrout/32/5275_2.png) [@eviltrout](https://meta.discourse.org/u/eviltrout)
#### Post date: [April 6, 2019, 1:15pm UTC](https://meta.discourse.org/t/strange-approvals-list/113305/12 "2019-04-06T13:15:54Z")

</div>

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.
