mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-27 17:46:05 -05:00
FIX: rake admin:create suggests better name
FIX: rake admin:create ensures account active
This commit is contained in:
parent
e347eea629
commit
a2a78fbad1
1 changed files with 5 additions and 2 deletions
|
@ -22,8 +22,7 @@ task "admin:create" => :environment do
|
||||||
# create new user
|
# create new user
|
||||||
admin = User.new
|
admin = User.new
|
||||||
admin.email = email
|
admin.email = email
|
||||||
username_random = Random.new()
|
admin.username = UserNameSuggester.suggest(admin.email)
|
||||||
admin.username = "admin_#{username_random.rand(9999)}"
|
|
||||||
begin
|
begin
|
||||||
password = ask("Password: ") {|q| q.echo = false}
|
password = ask("Password: ") {|q| q.echo = false}
|
||||||
password_confirmation = ask("Repeat password: ") {|q| q.echo = false}
|
password_confirmation = ask("Repeat password: ") {|q| q.echo = false}
|
||||||
|
@ -39,6 +38,10 @@ task "admin:create" => :environment do
|
||||||
end
|
end
|
||||||
end while !saved
|
end while !saved
|
||||||
|
|
||||||
|
say "\nEnsuring account is active!"
|
||||||
|
admin.active = true
|
||||||
|
admin.save
|
||||||
|
|
||||||
if existing_user
|
if existing_user
|
||||||
say("\nAccount updated successfully!")
|
say("\nAccount updated successfully!")
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue