Skip confirmation when creating first admin user

This commit is contained in:
Maikel Linke
2019-08-09 13:53:55 +10:00
parent b0e8ee42c1
commit af1f6f6c6d
2 changed files with 1 additions and 3 deletions

View File

@@ -56,6 +56,7 @@ def create_admin_user
say "\nWARNING: There is already a user with the email: #{email}, so no account changes were made. If you wish to create an additional admin user, please run rake spree_auth:admin:create again with a different email.\n\n"
else
admin = Spree::User.new(attributes)
admin.skip_confirmation!
if admin.save
role = Spree::Role.find_or_create_by_name 'admin'
admin.spree_roles << role

View File

@@ -51,7 +51,4 @@ end
# Create users:
require File.join(File.dirname(__FILE__), 'default', 'users')
spree_user = Spree::User.first
spree_user && spree_user.confirm!
DefaultStockLocation.find_or_create