Custom images can't be added to staged users

AI-generated summary

nathank reports that while Gravatar images can be applied to staged users, custom images cannot, and suggests allowing admins to set avatars for staged users. Jagster explains that Gravatars are tied to email addresses, while custom avatars require user interaction, which staged users lack. nathank shares a workaround involving converting the user to non-staged, uploading the image, and converting back. sam agrees with the suggestion and tags the post as pr-welcome.

I’ve got a few staged users that regularly interact with our site. Several are automatic emails (e.g. from Digital Ocean, AWS, etc). It would be nice to have them easily identified in the Message inbox.

Digital Ocean have a Gravatar, and a very helpful image is applied to their avatar even though they are staged:

However, when I try to add a custom picture (to AWS in this case), I get this:

If we can have Gravatars, why not custom images?

2 Likes

Because gravatar comes from email address, but custom avatar should come from user, and that can’t happen, because that user is staged. And no one ever build system where an admin can change avatar for staged users.

Just guessing, but you already knew that possibility.

2 Likes

I’ve got a workaround for this issue. It involves digging into the rails console (backup first!):

In the server

cd /var/discourse
./launcher enter app
rails c

Convert the user

Then convert the user so that they are no longer staged:

Email address of the staged user to be converted

User.find_by_email("=EMAIL=").update(staged: false)

Upload their picture

:up_arrow: Just as you would any other user

Convert them back to staged

Probably not necessary unless you really want them to stay ‘staged’

User.find_by_email("=EMAIL=").update(staged: true)

Done! Don’t forget to exit the console.

I haven’t had any issues with this (yet), but make no promises!

2 Likes

Honestly I can not think of any downsides to allowing admins to set the avatar for staged users.

Going to put a pr-welcome on this

1 Like