# Discourse-auto-deactivate writes the wrong message to the log

**URL:** <https://meta.discourse.org/t/discourse-auto-deactivate-writes-the-wrong-message-to-the-log/104397>\
**Category:** UX\
**Created:** [12월 16, 2018, 4:22오전 UTC](https://meta.discourse.org/t/discourse-auto-deactivate-writes-the-wrong-message-to-the-log/104397 "2018-12-16T04:22:20Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![chumstick](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/chumstick/32/122383_2.png) [@chumstick](https://meta.discourse.org/u/chumstick)\
**Post date:** [12월 16, 2018, 4:22오전 UTC](https://meta.discourse.org/t/discourse-auto-deactivate-writes-the-wrong-message-to-the-log/104397/1 "2018-12-16T04:22:21Z")

</div>

I am putting this here because the “bug” section had a definition that looked pretty stringent, and this isn’t really stopping the normal use of discourse.

Anyhow, I have discourse-auto-deactivate set to deactivate any account that hasn’t been active in 90 days. However, the plugin still writes “_Account inactive for more than 1 year._” when an account is deactivated. It’s really not the end of the world, or anything it’s just obnoxious to ~~all of our admins.~~ me. I wish it wasn’t, I wish I wasn’t having to bother anyone with this.

I was looking at the code on GitHub and found relatively easily the string in the locales/server.en.yaml - great! I’m an after-hours amateur dev, so this seems pretty straight forward:

- Clone the repo
- Fix the string “Account inactive for more than 1 year.” on line 7 of the [config/locales/server.en.yml](https://github.com/discourse/discourse-auto-deactivate/blob/928441d60efffb301da041274e80b020a1042a1e/config/locales/server.en.yml) to say “Account inactive for more than 90 days.”
- Commit the change back to the repo
- Modify my app.yaml to clone _my_ repo of the plugin at build rather than discourse official repo
- ???
- Profit.

Old, withered, and decayed memes aside, I just wanted to confirm that this all makes sense as a way to make my logs accurate. If I knew even a lick of Ruby I’d fix it so that it read the number of days from the settings yaml and worded the reason in a way that’s always accurate to the users settings or whatever, but I don’t know Ruby and I don’t plan on changing this ever again – so as a crude stop gap, is there a part of the process I’m not thinking about? Is there any possibility of me hosing the environment (I obviously recognize that anytime code is changed, there’s a risk, but I mean a risk that’s coming from a gross misunderstanding of what I’m changing vs. my end result.)

Thanks for all the help!

---

<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:** [12월 16, 2018, 4:32오전 UTC](https://meta.discourse.org/t/discourse-auto-deactivate-writes-the-wrong-message-to-the-log/104397/2 "2018-12-16T04:32:11Z")

</div>

Yes we should be using the value of the site setting here so this needs to use a string replacement. Perhaps this could be a good starter task, I will tag it.

---

<div class="post-metadata">

**Author:** ![jomaxro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jomaxro/32/126216_2.png) [@jomaxro](https://meta.discourse.org/u/jomaxro)\
**Post date:** [12월 16, 2018, 4:34오전 UTC](https://meta.discourse.org/t/discourse-auto-deactivate-writes-the-wrong-message-to-the-log/104397/3 "2018-12-16T04:34:59Z")

</div>

To expand on what Jeff said, ideally instead of

> [@chumstick](#):
>
> - Modify my app.yaml to clone _my_ repo of the plugin at build rather than discourse official repo

you’d

> - submit a pull request with your fix back to the official repo so everyone can benefit.

---

<div class="post-metadata">

**Author:** ![chumstick](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/chumstick/32/122383_2.png) [@chumstick](https://meta.discourse.org/u/chumstick)\
**Post date:** [12월 16, 2018, 4:41오전 UTC](https://meta.discourse.org/t/discourse-auto-deactivate-writes-the-wrong-message-to-the-log/104397/4 "2018-12-16T04:41:53Z")

</div>

> [@jomaxro](#):
>
> submit a pull request with your fix back to the official repo so everyone can benefit.

I totally would, if I knew how to fix it like Jeff suggested. He agreed with me that the proper fix would be to read it from the site settings. My limited capabilities however, only allow me to change the text of the string directly. Submitting a pull request where all I’ve changed is “1 year” to “90 days” would be a bit useless, I’d imagine (unless of course someone else also has _their_ deactivate set to 90 days as well).

Or is

> [@codinghorror](#):
>
> Perhaps this could be a good starter task,

The most subtle encouragement to “expand my horizons and learn something new” I’ve ever read?

---

<div class="post-metadata">

**Author:** ![jomaxro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jomaxro/32/126216_2.png) [@jomaxro](https://meta.discourse.org/u/jomaxro)\
**Post date:** [12월 16, 2018, 4:44오전 UTC](https://meta.discourse.org/t/discourse-auto-deactivate-writes-the-wrong-message-to-the-log/104397/5 "2018-12-16T04:44:49Z")

</div>

> [@chumstick](#):
>
> I totally would, if I knew how to fix it like Jeff suggested.

Gotcha. If you’re just looking to change the text for your site you _might_ be able to simply change it from `/admin/customize/site_texts`. Not positive (don’t have the plugin installed to test), but as it’s a string in a locale file, I’d assume you can.

---

<div class="post-metadata">

**Author:** ![saurabhp](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/saurabhp/32/125182_2.png) [@saurabhp](https://meta.discourse.org/u/saurabhp)\
**Post date:** [12월 21, 2018, 10:22오전 UTC](https://meta.discourse.org/t/discourse-auto-deactivate-writes-the-wrong-message-to-the-log/104397/6 "2018-12-21T10:22:31Z")

</div>

Hi,  
I have tried to fix it. PR for same:  
[https://github.com/discourse/discourse-auto-deactivate/pull/1](https://github.com/discourse/discourse-auto-deactivate/pull/1)

Thanks

---

<div class="post-metadata">

**Author:** ![saurabhp](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/saurabhp/32/125182_2.png) [@saurabhp](https://meta.discourse.org/u/saurabhp)\
**Post date:** [1월 3, 2019, 3:30오전 UTC](https://meta.discourse.org/t/discourse-auto-deactivate-writes-the-wrong-message-to-the-log/104397/7 "2019-01-03T03:30:30Z")

</div>

PR is merged. We can close this. 😄

---

<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:** [1월 3, 2019, 3:31오전 UTC](https://meta.discourse.org/t/discourse-auto-deactivate-writes-the-wrong-message-to-the-log/104397/8 "2019-01-03T03:31:59Z")

</div>


