2012-11-21 22:31:42 +01:00
|
|
|
from django.core.management.base import BaseCommand
|
2013-01-10 22:01:33 +01:00
|
|
|
from zephyr.lib.actions import do_create_realm
|
2012-11-21 22:31:42 +01:00
|
|
|
|
|
|
|
class Command(BaseCommand):
|
|
|
|
help = "Create a realm for the specified domain(s)."
|
|
|
|
|
|
|
|
def handle(self, *args, **options):
|
|
|
|
for domain in args:
|
2012-12-04 21:32:58 +01:00
|
|
|
realm, created = do_create_realm(domain)
|
|
|
|
if created:
|
2012-11-21 22:31:42 +01:00
|
|
|
print domain + ": Created."
|
2012-12-04 21:32:58 +01:00
|
|
|
else:
|
|
|
|
print domain + ": Already exists."
|
2012-11-21 22:31:42 +01:00
|
|
|
|