Public profiles for imported, inactive users

I’m migrating the content and user profiles from an old project and since the users in the project are no longer active, I decided to import them with active = false, which works great to avoid sending them emails that they won’t care about.

The only problem is that the profiles of inactive users are not visible by logged out visitors, which is a big part of the migration, keeping both the content and the user profiles reachable. I’m still getting traffic for the old URLs which I plan on redirecting to their Discourse equivalent.

I can think of two solutions, but none of them feels optimal:

  • Keep the users inactive and write a plugin to reopen UserController and rewrite the show method to force include_inactive: true in fetch_user_from_params. Doesn’t feel great because I would be duplicating the whole method to change a single line.

  • Activate the users, and disable all their email preferences. Not sure if it would be safe to rely on that to avoid all emails.

Any ideas?

You could import them as active and then suspend them indefinitely.

Deactivated is slightly more correct, because it means the user needs to log in and fully validate their email to “complete their signup” before proceeding. But if you want the accounts to be fully visible, deactivating won’t work.

2 Likes