diff --git a/lib/tasks/admin.rake b/lib/tasks/admin.rake index 70099276d..dd88fc63a 100644 --- a/lib/tasks/admin.rake +++ b/lib/tasks/admin.rake @@ -22,8 +22,7 @@ task "admin:create" => :environment do # create new user admin = User.new admin.email = email - username_random = Random.new() - admin.username = "admin_#{username_random.rand(9999)}" + admin.username = UserNameSuggester.suggest(admin.email) begin password = ask("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 while !saved + say "\nEnsuring account is active!" + admin.active = true + admin.save + if existing_user say("\nAccount updated successfully!") else