# Deactivating a user causes account to be deleted?

**URL:** https://meta.discourse.org/t/deactivating-a-user-causes-account-to-be-deleted/68642
**Category:** Support
**Created:** [August 23, 2017, 5:31pm UTC](https://meta.discourse.org/t/deactivating-a-user-causes-account-to-be-deleted/68642 "2017-08-23T17:31:41Z")
**Posts on this page:** 16
**Page:** 1

<div class="post-metadata">

### Author: ![InspektorCluzo](https://avatars.discourse-cdn.com/v4/letter/i/c68b51/32.png) [@InspektorCluzo](https://meta.discourse.org/u/InspektorCluzo)
#### Post date: [August 23, 2017, 5:31pm UTC](https://meta.discourse.org/t/deactivating-a-user-causes-account-to-be-deleted/68642/1 "2017-08-23T17:31:41Z")

</div>

Possibly I don’t understand the FSM for deactivation.

We recently deactivated a user twice, because, for some reason, they seemed to have a problem with _forget pwd_, and we sent two reactivation emails.

The second time, the account disappeared altogether – it appears to have been somehow auto-deleted. We are able to create a new account with the same account name and the same email address as the previous one.

What am I misunderstanding about deactivation?

---

<div class="post-metadata">

### Author: ![cpradio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cpradio/32/4970_2.png) [@cpradio](https://meta.discourse.org/u/cpradio)
#### Post date: [August 23, 2017, 5:36pm UTC](https://meta.discourse.org/t/deactivating-a-user-causes-account-to-be-deleted/68642/2 "2017-08-23T17:36:38Z")

</div>

There is a setting `purge unactivated users grace period days`, if an account is still deactivated, **has zero posts** , and that grace period is met, it deletes the account.

---

<div class="post-metadata">

### Author: ![InspektorCluzo](https://avatars.discourse-cdn.com/v4/letter/i/c68b51/32.png) [@InspektorCluzo](https://meta.discourse.org/u/InspektorCluzo)
#### Post date: [August 23, 2017, 5:38pm UTC](https://meta.discourse.org/t/deactivating-a-user-causes-account-to-be-deleted/68642/3 "2017-08-23T17:38:37Z")

</div>

Hmm. Set at 14 days for us, but we saw the deletion within 24 hours. This may be a bug.

---

<div class="post-metadata">

### Author: ![cpradio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cpradio/32/4970_2.png) [@cpradio](https://meta.discourse.org/u/cpradio)
#### Post date: [August 23, 2017, 5:54pm UTC](https://meta.discourse.org/t/deactivating-a-user-causes-account-to-be-deleted/68642/4 "2017-08-23T17:54:32Z")

</div>

When was the user account created? As it is based on the user’s creation date. Not when they were deactivated

---

<div class="post-metadata">

### Author: ![InspektorCluzo](https://avatars.discourse-cdn.com/v4/letter/i/c68b51/32.png) [@InspektorCluzo](https://meta.discourse.org/u/InspektorCluzo)
#### Post date: [August 23, 2017, 5:56pm UTC](https://meta.discourse.org/t/deactivating-a-user-causes-account-to-be-deleted/68642/5 "2017-08-23T17:56:13Z")

</div>

> [@cpradio](#):
>
> When was the user account created? As it is based on the user’s creation date. Not when they were deactivated

Do you mean that, if you deactivate an old user account to send a re-activation email, it will be deleted right away? This would seem counter-intuitive.

---

<div class="post-metadata">

### Author: ![cpradio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cpradio/32/4970_2.png) [@cpradio](https://meta.discourse.org/u/cpradio)
#### Post date: [August 23, 2017, 6:00pm UTC](https://meta.discourse.org/t/deactivating-a-user-causes-account-to-be-deleted/68642/6 "2017-08-23T18:00:34Z")

</div>

I suppose I do (sort of). Granted, I think it only deletes them if they have zero posts too. I’d have to find the actual logic in the code, but I think there are some fail safes for users that have “activity” when they are deactivated. It is only for users who have no activity.

**Edited:** Code block

> <https://github.com/discourse/discourse/blob/1146772debf861c5c8b6e4e3cebdba31a1138922/app/models/user.rb#L1063-L1078>

---

<div class="post-metadata">

### Author: ![InspektorCluzo](https://avatars.discourse-cdn.com/v4/letter/i/c68b51/32.png) [@InspektorCluzo](https://meta.discourse.org/u/InspektorCluzo)
#### Post date: [August 23, 2017, 6:08pm UTC](https://meta.discourse.org/t/deactivating-a-user-causes-account-to-be-deleted/68642/7 "2017-08-23T18:08:08Z")

</div>

> [@cpradio](#):
>
> I suppose I do (sort of). Granted, I think it only deletes them if they have zero posts too.

This would explain the delete we saw. Old user, but no posts.

---

<div class="post-metadata">

### Author: ![neil](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/neil/32/102150_2.png) [@neil](https://meta.discourse.org/u/neil)
#### Post date: [August 23, 2017, 6:32pm UTC](https://meta.discourse.org/t/deactivating-a-user-causes-account-to-be-deleted/68642/8 "2017-08-23T18:32:28Z")

</div>

Deactivating a user because they report troubles logging in isn’t the right action. They should figure out if they entered the wrong email, forgot their password, or some other issue and fix that instead.

---

<div class="post-metadata">

### Author: ![InspektorCluzo](https://avatars.discourse-cdn.com/v4/letter/i/c68b51/32.png) [@InspektorCluzo](https://meta.discourse.org/u/InspektorCluzo)
#### Post date: [August 23, 2017, 7:01pm UTC](https://meta.discourse.org/t/deactivating-a-user-causes-account-to-be-deleted/68642/9 "2017-08-23T19:01:58Z")

</div>

> [@neil](#):
>
> Deactivating a user because they report troubles logging in isn’t the right action.

Multiple users have not been able to get “Forget password” working for them, which was the right tool but failed to work for them. For those for whom it failed, we tried to resolve their login problem by sending them a re-activation email.

---

<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: [August 23, 2017, 7:19pm UTC](https://meta.discourse.org/t/deactivating-a-user-causes-account-to-be-deleted/68642/10 "2017-08-23T19:19:42Z")

</div>

None of what you describe requires deactivating the account.

---

<div class="post-metadata">

### Author: ![InspektorCluzo](https://avatars.discourse-cdn.com/v4/letter/i/c68b51/32.png) [@InspektorCluzo](https://meta.discourse.org/u/InspektorCluzo)
#### Post date: [August 23, 2017, 9:44pm UTC](https://meta.discourse.org/t/deactivating-a-user-causes-account-to-be-deleted/68642/11 "2017-08-23T21:44:55Z")

</div>

> [@codinghorror](#):
>
> None of what you describe requires deactivating the account.

What should be the next step when a user is not able to reset his/her pwd with _forget password_?

---

<div class="post-metadata">

### Author: ![neil](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/neil/32/102150_2.png) [@neil](https://meta.discourse.org/u/neil)
#### Post date: [August 23, 2017, 9:55pm UTC](https://meta.discourse.org/t/deactivating-a-user-causes-account-to-be-deleted/68642/12 "2017-08-23T21:55:10Z")

</div>

They should check their spam/junk folders, filters, and other reasons they may not be receiving emails. Also, make sure they typed their email addresses correctly when they signed up.

---

<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: [August 23, 2017, 10:11pm UTC](https://meta.discourse.org/t/deactivating-a-user-causes-account-to-be-deleted/68642/13 "2017-08-23T22:11:41Z")

</div>

Just to amplify on this, Discourse offers an opportunity to correct email after signup as of version 1.8.

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

Also @InspektorCluzo users can initiate “forgot password, please send me an email to reset” on their own, as much as they like.

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

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

We also added an “oh no I can’t get an email” help page in 1.9, triggerable via the help button above.

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

well, there are rate limits on password reset requests, but you know what I mean

---

<div class="post-metadata">

### Author: ![InspektorCluzo](https://avatars.discourse-cdn.com/v4/letter/i/c68b51/32.png) [@InspektorCluzo](https://meta.discourse.org/u/InspektorCluzo)
#### Post date: [August 23, 2017, 11:54pm UTC](https://meta.discourse.org/t/deactivating-a-user-causes-account-to-be-deleted/68642/14 "2017-08-23T23:54:02Z")

</div>

Thanks, @neil, @codinghorror.

When we were invite-only, we had significant problems with login, with about 1/3 of the users unable to login the second time. I think it must have been users unable to login when they registered on one device but tried to login from another. At the time, _forget password_ did not appear to work for any of them. We ended up systematically entering temp pwds in users accounts, emailing them the pwds and asking them to change them - very insecure MO.

We have hardly had any login trouble since moving to regular registration, but as a carry-over from the past we just assumed that forget-pwd was broken enough that it was not worth investing time into trying to get it to work. We will be more thorough from here on.

Is there a simple, Discourse-based way to give users who can’t login a way to contact the forum, that would land into a Discourse admin or mod thread? This would be really helpful to us, since our community is Discourse-only at this time.

---

<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: [August 23, 2017, 11:57pm UTC](https://meta.discourse.org/t/deactivating-a-user-causes-account-to-be-deleted/68642/15 "2017-08-23T23:57:28Z")

</div>

Make sure you have contact info specified in your site settings, as you can see above the help page for login directs people to the `/about` page – your contact email / web info should be on that page if it is entered in site settings. Like so:

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

On our Discourse, an email to `team@discourse.org` automatically creates a PM to the team group.

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [June 8, 2024, 12:44pm UTC](https://meta.discourse.org/t/deactivating-a-user-causes-account-to-be-deleted/68642/16 "2024-06-08T12:44:24Z")

</div>

This topic was automatically closed after 2480 days. New replies are no longer allowed.
