Rake task for merging users

I’m running into trouble with this command and my SSO setup, which appears to fail silently if a user changes their email address to an address that exists already in the secondary email field. The email address changes in wordpress and all appears to be well, but it does not change in discourse.

When I run @gerhard’s rails commands to remove secondary emails first, then change the email address in wordpress, it changes successfully in discourse.

The primary email address is not an issue, because if someone tries to change their email address to an address that already exists in wordpress, it doesn’t let them.

Does anyone have any suggestions? Is it possible to disable the secondary email address field, or to have the API ignore it or use it better? E.g. if the email address exists as secondary, just move what was primary to secondary and move what was secondary to primary?

1 Like