Can't change an imported user's primary email

Hi there, I’m trying to help a user that was imported from my Drupal forum into Discourse with a password reset email. We’re having trouble with the primary address, and so I added a secondary one to his profile. But he says it says that no such registered email exists when he tries to request a password reset. So I tried to change the secondary to primary and the primary to secondary. But the change simply gets reverted, it won’t stick. And now Discourse is telling me (the admin and moderator) “You’ve performed this action too many times” when I try to change it (using a different browser in Discourse safe mode, just to eliminate that as the cause of the problem). I found this tip for changing it in the Rails console, but it doesn’t look right where it says wmail instead of email :

2 Likes

So try it without the typo. :slight_smile:

2 Likes

:slight_smile: Thanks Jay. It doesn’t seem to work:

SyntaxError: unexpected label, expecting ')'
..._id: u.id).first.update (email: "user@email.com")
...                         ^~~~~~
SyntaxError: unexpected ')', expecting end-of-input
...email: "user@email.com")
...

Re-categorizing this as a bug, as the UI should always allow changing a user’s email and it shouldn’t rate-limit the admin.

Would clearing the Redis cache help I wonder?

There were two more typos in that.

I don’t think so.

My best guess is that you imported the email address with caps or some hidden character, perhaps. I would try to change to a different email rather than add a secondary.

Hmm, nope, the address is good, I pasted it into my email client and sent a message to it. I did try to change the primary, but it just keeps the primary and puts the secondary one after as unverified.

It is unclear what the bug is from the first post. I am moving back to support

Please see:

We need more info here.

Hi there, I’m sorry if there wasn’t enough information, but I honestly don’t understand what was missing. I did try it with safe mode as mentioned earlier.

Is this the expected behavior?

I would say that the administrator should never be rate-limited.

This worked for me

u=User.find_by_username("XXXXXX") 
UserEmail.find_by(user_id: u.id).update(email: "XXXX@XXX.com")
3 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.