# Post Edits report

**URL:** https://meta.discourse.org/t/post-edits-report/111471
**Category:** Feature
**Created:** [March 13, 2019, 1:35pm UTC](https://meta.discourse.org/t/post-edits-report/111471 "2019-03-13T13:35:11Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![outofthebox](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/outofthebox/32/83708_2.png) [@outofthebox](https://meta.discourse.org/u/outofthebox)
#### Post date: [March 13, 2019, 1:35pm UTC](https://meta.discourse.org/t/post-edits-report/111471/1 "2019-03-13T13:35:11Z")

</div>

Hi,

Most of the time when I check the post edits report, I am interested to know when someone has edited _someone else’s_ post. That seems like the most likely place for abuse of privileges. Is there a good way to check this subset of post edits? If not, I think it would be a small improvement to have this as the default or as an optional view.

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [March 13, 2019, 3:49pm UTC](https://meta.discourse.org/t/post-edits-report/111471/2 "2019-03-13T15:49:27Z")

</div>

Seems like a good query candidate for the #plugin:data-explorer.

---

<div class="post-metadata">

### Author: ![outofthebox](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/outofthebox/32/83708_2.png) [@outofthebox](https://meta.discourse.org/u/outofthebox)
#### Post date: [March 14, 2019, 12:27pm UTC](https://meta.discourse.org/t/post-edits-report/111471/3 "2019-03-14T12:27:37Z")

</div>

Yea, that would work too. It seems a little bit more intuitive to me to have it built into the post edits report on the Moderation tab, as that keeps this potential area for abuse more visible and prominent, but either way would be nice.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [May 7, 2019, 5:58am UTC](https://meta.discourse.org/t/post-edits-report/111471/4 "2019-05-07T05:58:25Z")

</div>

I tend to agree this should be the default. Seeing a list of self edits is .. considerably less than useful @zogstrip

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [May 7, 2019, 8:02am UTC](https://meta.discourse.org/t/post-edits-report/111471/5 "2019-05-07T08:02:31Z")

</div>

Yes, my bad. I didn’t realize we had a “Post Edits Report” (so many of them now 😮).

@nbianca can you change the query of that report so we don’t show the edits made by the author of the post?

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [May 7, 2019, 8:04am UTC](https://meta.discourse.org/t/post-edits-report/111471/7 "2019-05-07T08:04:00Z")

</div>

Also I think I see a 20 limit there, is that hard coded for a reason?

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [May 7, 2019, 8:04am UTC](https://meta.discourse.org/t/post-edits-report/111471/8 "2019-05-07T08:04:01Z")

</div>

If it helps this is the query I used but I am not sure it gets everything

```sql
SELECT
    p.id AS post_id,
    u2.username, 
    topic_id
FROM posts p
    JOIN users u
        ON u.id = p.user_id
    JOIN topics t
        ON t.id = p.topic_id
    JOIN users u2
        ON u2.id = p.last_editor_id
WHERE (p.last_editor_id > 1 AND p.last_editor_id <> p.user_id)
    AND p.self_edits > 0
    AND p.deleted_at IS NULL
    AND u2.trust_level > 2
    AND u2.moderator = false
    AND u2.admin = false
    AND t.deleted_at IS NULL
    AND t.archetype = 'regular'
ORDER BY p.updated_at DESC
LIMIT 500

```

Note that this rules out users who are staff as well as the system user, so basically the above query is just TL3 users editing around the site to tidy things up.

You could use this query as is @outofthebox in [Data Explorer](https://meta.discourse.org/t/32566?silent=true) in the meantime…

---

<div class="post-metadata">

### Author: ![outofthebox](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/outofthebox/32/83708_2.png) [@outofthebox](https://meta.discourse.org/u/outofthebox)
#### Post date: [May 7, 2019, 12:22pm UTC](https://meta.discourse.org/t/post-edits-report/111471/9 "2019-05-07T12:22:18Z")

</div>

I’m so encouraged by this update - thank you for improving this report!

@codinghorror, thank you for the [Data Explorer](https://meta.discourse.org/t/32566?silent=true) query. That helped me quickly identify the edits with the greatest risk for abuse over the past few months. Thankfully, it was nice to see that all the ones I checked had been made to improve our community.

---

<div class="post-metadata">

### Author: ![nbianca](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nbianca/32/157984_2.png) [@nbianca](https://meta.discourse.org/u/nbianca)
#### Post date: [May 8, 2019, 8:14pm UTC](https://meta.discourse.org/t/post-edits-report/111471/10 "2019-05-08T20:14:41Z")

</div>

I have removed the self edits from the Post Edits report:

[https://github.com/discourse/discourse/pull/7510](https://github.com/discourse/discourse/pull/7510)

---

<div class="post-metadata">

### Author: ![nbianca](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nbianca/32/157984_2.png) [@nbianca](https://meta.discourse.org/u/nbianca)
#### Post date: [May 10, 2019, 11:11am UTC](https://meta.discourse.org/t/post-edits-report/111471/11 "2019-05-10T11:11:38Z")

</div>


