Project

General

Profile

0001-tenant-make-it-possible-for-create_tenant-to-get-dom.patch

Frédéric Péters, 10 February 2015 12:08 PM

Download (1.34 KB)

View differences:

Subject: [PATCH] tenant: make it possible for create_tenant to get domains
 from stdin (#6464)

 .../djommon/multitenant/management/commands/create_tenant.py       | 7 +++++++
 1 file changed, 7 insertions(+)
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
-