2014-01-07 18:04:26 +01:00
|
|
|
from __future__ import absolute_import
|
2015-11-01 17:11:06 +01:00
|
|
|
from __future__ import print_function
|
2014-01-07 18:04:26 +01:00
|
|
|
|
|
|
|
from django.core.management.base import BaseCommand
|
|
|
|
|
|
|
|
from zerver.lib.actions import do_deactivate_realm
|
|
|
|
from zerver.models import get_realm
|
|
|
|
|
|
|
|
class Command(BaseCommand):
|
|
|
|
help = """One-off script to deactivate our old realms."""
|
|
|
|
|
2015-09-20 04:10:27 +02:00
|
|
|
def add_arguments(self, parser):
|
|
|
|
parser.add_argument('domain', metavar='<domain>', type=str,
|
|
|
|
help='domain of realm to deactivate')
|
|
|
|
|
2014-01-07 18:04:26 +01:00
|
|
|
def handle(self, *args, **options):
|
2015-11-01 17:11:06 +01:00
|
|
|
print("Deactivating", options["domain"])
|
2015-09-20 04:10:27 +02:00
|
|
|
do_deactivate_realm(get_realm(options["domain"]))
|
2015-11-01 17:11:06 +01:00
|
|
|
print("Done!")
|