Commit 360b4961 authored by Daniel Dehennin's avatar Daniel Dehennin

fix(setup): admin users should not receive admin granting email

They are already admin users so don't send a mail each time
`discourse.setup.users` state is run.
parent e39e43ca
......@@ -62,14 +62,16 @@ run:
end
if is_admin
user.grant_admin!
if not user.admin
user.grant_admin!
user.email_tokens.update_all confirmed: true
end
if user.trust_level < 1
user.change_trust_level!(1)
end
user.email_tokens.update_all confirmed: true
user.activate
puts "User #{args[:email]}: account now has Admin privileges!"
puts "User #{args[:email]}: account has Admin privileges!"
else
user.revoke_admin!
if user.trust_level < 1
......@@ -78,6 +80,6 @@ run:
user.email_tokens.update_all confirmed: true
user.activate
puts "User #{args[:email]}: account now has User privileges!"
puts "User #{args[:email]}: account has Regular privileges!"
end
end
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment