mirror of
https://github.com/discourse/discourse.git
synced 2025-01-18 12:02:46 +08:00
Fix user is nil in populate posts.
This commit is contained in:
parent
610728a70f
commit
bdbde02d2c
|
@ -60,7 +60,8 @@ class Populate < Thor
|
|||
private
|
||||
|
||||
def create_user(user_email)
|
||||
unless User.find_by_email(user_email)
|
||||
user = User.find_by_email(user_email)
|
||||
unless user
|
||||
puts "Creating new account: #{user_email}"
|
||||
user = User.create!(email: user_email, password: SecureRandom.hex, username: UserNameSuggester.suggest(user_email))
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue
Block a user