mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
tl1 should be enough for grant admin. tl4 is hard to revert
This commit is contained in:
parent
1ba953077e
commit
0d6cfe45bf
@ -19,7 +19,10 @@ task "admin:invite", [:email] => [:environment] do |_, args|
|
|||||||
|
|
||||||
puts "Granting admin!"
|
puts "Granting admin!"
|
||||||
user.grant_admin!
|
user.grant_admin!
|
||||||
user.change_trust_level!(4)
|
if user.trust_level < 1
|
||||||
|
user.change_trust_level!(1)
|
||||||
|
end
|
||||||
|
|
||||||
user.email_tokens.update_all confirmed: true
|
user.email_tokens.update_all confirmed: true
|
||||||
|
|
||||||
puts "Sending email!"
|
puts "Sending email!"
|
||||||
@ -81,7 +84,9 @@ task "admin:create" => :environment do
|
|||||||
grant_admin = ask("Do you want to grant Admin privileges to this account? (Y/n) ")
|
grant_admin = ask("Do you want to grant Admin privileges to this account? (Y/n) ")
|
||||||
if (grant_admin == "" || grant_admin.downcase == 'y')
|
if (grant_admin == "" || grant_admin.downcase == 'y')
|
||||||
admin.grant_admin!
|
admin.grant_admin!
|
||||||
admin.change_trust_level!(4)
|
if user.trust_level < 1
|
||||||
|
user.change_trust_level!(1)
|
||||||
|
end
|
||||||
admin.email_tokens.update_all confirmed: true
|
admin.email_tokens.update_all confirmed: true
|
||||||
admin.activate
|
admin.activate
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user