DEV: Rake task for creating admin should ask for full name if required (#11096)

This commit is contained in:
Gerhard Schlager 2020-11-02 11:12:42 +01:00 committed by GitHub
parent 1476e17c35
commit 5c662128d3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -74,6 +74,10 @@ task "admin:create" => :environment do
admin.password = password
end
if SiteSetting.full_name_required && admin.name.blank?
admin.name = ask("Full name: ")
end
# save/update user account
saved = admin.save
say(admin.errors.full_messages.join("\n")) unless saved