Staged users remain staged even after activation and must be manually unstaged

(Stephen Chung) #1

This is similar to:

except that when a user is staged, meaning that it came in via email in, and after their account is activated (either by the admin or by sending out an activation email which they reacted to), they can log into the system and do things like a regular user.

Except that they user account stays staged. There is no way to clear the staged flag.

So, user needs to be automatically unstaged not only when loggin in via OAuth, but simply when they are activated via any means.

(Jeff Atwood) #2

What do you think @zogstrip?

(Stephen Chung) #4

Just in case other people needs to manually unstage a user:

Step 0: SSH to your VM


Step 1: Enter the discourse container

cd /var/discourse
sudo ./launcher enter app

Step 2: Enter the Rails console

rails c

Step 3, Option 1: Unstage the user by email address

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

Step 3, Option 2: Unstage the user by username

User.where(username: "username").update_all(staged: false)

Step 4: Finito, get out

Press ^D a few times to get back out.

(jj11909) #5


Is this still accurate? I was trying to do this and keep getting: undefined method `update" for nil:NilClass

(Stephen Chung) #6

AFAIK this is still true.

If you got a nil error on update, then it is likely that you mis-typed the email address. User.find_by_email didn’t find it and so returned nil.

(Stephen Chung) #7

Anyone in team gonna take a look at this?
It seems to be still not fixed.

(RĂ©gis Hanol) #8

We’ll now always unstage user when they log in :banana:

(Stephen Chung) #9

Great. This is a great help.

There is one more issue. For staged uses, pressing the Send Activation Email button doesn’t send the email. The email logs show that the signup email has been sent, but the email is actually not sent.

I wonder if it is filtered out somewhere.

(RĂ©gis Hanol) #12

Just tried and it worked fine. Was your sidekiq queue full?

(Stephen Chung) #13

Not really… It is just that the email is not sent, but it says sent in under Email->Sent.

Sidekiq not full.

The only way I get to invite staged people right now is 1) Activate them by hand, 2) Press Send Password Reset email.

(RĂ©gis Hanol) #14

Have you checked the logs of your SMTP provider/API?

(Stephen Chung) #15

I’ll go do some more digging around after I upgrade to the latest and greatest.

It is strange that the Password Reset email got sent IMMEDIATELY, while the activation emails don’t ever get sent/received.