From e6febf1e8b74390533c52c469b132cd2a5da5392 Mon Sep 17 00:00:00 2001 From: Marc 'risson' Schmitt Date: Tue, 16 Jan 2024 11:08:26 +0100 Subject: [PATCH] Revert "add management command to create a tenant" This reverts commit 39d13c0447b7dc1e4b8f960fb7cdf0797b4445fc. --- .../tenants/management/commands/__init__.py | 0 .../tenants/management/commands/add_tenant.py | 31 ------------------- 2 files changed, 31 deletions(-) delete mode 100644 authentik/tenants/management/commands/__init__.py delete mode 100644 authentik/tenants/management/commands/add_tenant.py diff --git a/authentik/tenants/management/commands/__init__.py b/authentik/tenants/management/commands/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/authentik/tenants/management/commands/add_tenant.py b/authentik/tenants/management/commands/add_tenant.py deleted file mode 100644 index 93c9072cc..000000000 --- a/authentik/tenants/management/commands/add_tenant.py +++ /dev/null @@ -1,31 +0,0 @@ -"""authentik add tenant command""" -from django.core.management.base import BaseCommand -from django.utils.text import slugify -from structlog.stdlib import get_logger - -from authentik.lib.config import CONFIG -from authentik.tenants.models import Domain, Tenant - -LOGGER = get_logger() - - -class Command(BaseCommand): - """Add tenant""" - - def add_arguments(self, parser): - parser.add_argument("--domain", nargs="+", type=str) - parser.add_argument( - "name", - type=str, - ) - - def handle(self, *args, **options): - """Add tenant""" - if not CONFIG.get_bool("tenants.enabled"): - self.stderr.write("Tenant not enabled") - return - tenant = Tenant.objects.create(name=options["name"], schema_name=slugify(options["name"])) - LOGGER.info("Created tenant", uuid=str(tenant.pk)) - for domain in options["domain"]: - Domain.objects.create(tenant=tenant, domain=domain) - LOGGER.info("Created domain", domain=domain)