Copy the main tenant administrator login credentials into the new tenant

Co-Authored-By: Senén Rodero <senenrodero@gmail.com>
This commit is contained in:
taitus
2022-12-15 14:35:07 +01:00
committed by Senén Rodero Rodríguez
parent 171cf4e634
commit 951eec7d08
7 changed files with 51 additions and 1 deletions

View File

@@ -1,5 +1,5 @@
# Default admin user (change password after first deploy to a server!)
if Administrator.count == 0 && !Rails.env.test?
if Administrator.count == 0 && (!Rails.env.test? || !Tenant.default?)
admin = User.create!(username: "admin", email: "admin@consul.dev", password: "12345678",
password_confirmation: "12345678", confirmed_at: Time.current,
terms_of_service: "1")