feat: Add script to ensure public tenant and its domain exist.
This commit is contained in:
@@ -49,12 +49,13 @@ def ensure_public_tenant():
|
||||
print(f"WARNING: Domain {domain_name} is assigned to another tenant!")
|
||||
|
||||
# 3. Init system data (System Customer, etc.)
|
||||
print("Initializing system data for public tenant...")
|
||||
from django.core.management import call_command
|
||||
try:
|
||||
call_command('init_tenant_data', schema='public')
|
||||
except Exception as e:
|
||||
print(f"Error initializing system data: {e}")
|
||||
# SKIP for public tenant as it doesn't have these tables (they separate in tenant schemas)
|
||||
# print("Initializing system data for public tenant...")
|
||||
# from django.core.management import call_command
|
||||
# try:
|
||||
# call_command('init_tenant_data', schema='public')
|
||||
# except Exception as e:
|
||||
# print(f"Error initializing system data: {e}")
|
||||
|
||||
if __name__ == '__main__':
|
||||
ensure_public_tenant()
|
||||
|
||||
Reference in New Issue
Block a user