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

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 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!

3 Likes

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.

1 Like

To expand on what Jeff said, ideally instead of

you’d

  • 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

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

1 Like

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.

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

Thanks

4 Likes

PR is merged. We can close this. :smile:

4 Likes