mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: When activating a user, ensure the change is reflected immediately
When activating a user via an external provider, this would cause the "this account is not activated" message to show on the first attempt, even though the account had been activated correctly.
This commit is contained in:
@@ -903,10 +903,8 @@ class User < ActiveRecord::Base
|
||||
def activate
|
||||
if email_token = self.email_tokens.active.where(email: self.email).first
|
||||
user = EmailToken.confirm(email_token.token, skip_reviewable: true)
|
||||
self.update!(active: true) if user.nil?
|
||||
else
|
||||
self.update!(active: true)
|
||||
end
|
||||
self.update!(active: true)
|
||||
create_reviewable
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user