0001-tenant-make-it-possible-for-create_tenant-to-get-dom.patch
entrouvert/djommon/multitenant/management/commands/create_tenant.py | ||
---|---|---|
1 | 1 |
import os |
2 |
import sys |
|
2 | 3 | |
3 | 4 |
from django.db import connection |
4 | 5 |
from django.core.management.base import CommandError, BaseCommand |
... | ... | |
13 | 14 |
if not args: |
14 | 15 |
raise CommandError("you must give at least one tenant hostname") |
15 | 16 | |
17 |
# if - is given on the command line, get list of hostnames from stdin |
|
18 |
if '-' in args: |
|
19 |
args = list(args) |
|
20 |
args.remove('-') |
|
21 |
args.extend([x.strip() for x in sys.stdin.readlines()]) |
|
22 | ||
16 | 23 |
for hostname in args: |
17 | 24 |
try: |
18 | 25 |
tenant_base = TenantMiddleware.base() |
19 |
- |