I have a user account that was used to install the application with a given email address. Let’s call it firstname.lastname@example.org. This email account was originally set as the administrator in the system when it was set up. After creating a second administrator account, the one using email@example.com was “demoted” to a regular user and then the account was deleted. Next, the email address was invited again to the system.
Upon logging in using firstname.lastname@example.org, the account becomes an administrator. It appears that if the account used to perform the install cannot be added back to the system without it becoming an administrator. This seems to be a bug but if not, there should at least be a way to change the default system administrator email address.
My guess is that something is being cached somewhere but I can’t figure out where. I edited the app.yml file to use a different email address. I also did a database dump after deleting this account and found that the email address still exists in the following tables:
- email_logs - Seems to make sense, since it’s just a historical record
- email_tokens - Shouldn’t this have been deleted when the user was deleted?
- user_histories - Also sort of makes sense because it’s a historical record
I’ve gone so far as to:
- update the token, email and expired values in the email_tokens table
- update the app.yml file with a new address
- restart discourse
Nothing seems to work to completely wipe this account from the system such that when it signs up again, Discourse doesn’t make the account with that email address as an admin.