# לא ניתן למחוק משתמש עם הודעות פרטיות, הודעת שגיאה מטעה

**URL:** <https://meta.discourse.org/t/cant-delete-user-with-pms-misleading-error-message/191969>\
**Category:** Bug\
**Created:** [28 במאי,‏ 2021,‏ 7:56pm UTC](https://meta.discourse.org/t/cant-delete-user-with-pms-misleading-error-message/191969 "2021-05-28T19:56:26Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![mentalstring](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mentalstring/32/168934_2.png) [@mentalstring](https://meta.discourse.org/u/mentalstring)\
**Post date:** [28 במאי,‏ 2021,‏ 7:56pm UTC](https://meta.discourse.org/t/cant-delete-user-with-pms-misleading-error-message/191969/1 "2021-05-28T19:56:26Z")

</div>

We are using SSO and when someone closes their account, we delete their Discourse account too through the API (or anonymize it, if there’s posts).

However, something seems to be amiss as we have been seeing some 403 errors while doing this. Poking a little bit, I found this to be the error message returned by the API call:

```plaintext
{
    "http_code": 403,
    "body": "{\"deleted\":false,\"message\":\"User XXX has 0 posts, so they can't be deleted.\"}"
}

```

Bit, if there’s 0 posts, it should be possible to be deleted? Looking at the info for this particular account, there’s indeed no posts:

 ![Screenshot 2021-05-28 at 19.37.30](https://global.discourse-cdn.com/meta/original/3X/3/3/33b1c025c0942f723a7f4b08d14037718e2cf42e.png)

However, there’s a private message to Discobot (tutorial).

 ![Screenshot 2021-05-28 at 19.36.29](https://global.discourse-cdn.com/meta/original/3X/2/5/2552e7eb72c6f7385060bee370b5fa17c1e9372d.png)

So, I think there’s a few things here:

1. The error message that refused the deletion of the user is counting only the public posts, but perhaps it should count private too?
2. Actually, should the private messages prevent an account from being deleted? I understand the reasoning for how removing an account complicates the narrative on a public topic, but on a private message perhaps the argument is not as solid?
3. If the answer to the previous one is still a yes (ie, private message should still prevent removing an account from being removed), should messages to Discobot count too, towards preventing an account from being removed? What I mean is, most people will go through the tutorial and send PMs to Discobot… which makes it virtually impossible to remove many accounts that never participated, just because they did the tutorial (perhaps this is true only after `delete_user_max_post_age` days, but still).

Lastly, and I’m not sure if this is related with 1., but when checking the API info for this user, it returns:  
`post_count: 0`  
`can_be_deleted: 1`  
`can_delete_all_posts: 0`

But, effectively, this user can’t be deleted. So perhaps the `can_be_deleted` logic is counting only public posts too?

---

_[View the full topic](https://meta.discourse.org/t/cant-delete-user-with-pms-misleading-error-message/191969)._
