Commit c6ae12ec authored by Barconnière Fabrice's avatar Barconnière Fabrice

Merge branch 'fix/limit-createuser-mails' into 'master'

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

See merge request la-crise/discourse-formula!4
parents e39e43ca 360b4961
......@@ -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