2019-02-02 23:53:29 +01:00
|
|
|
from typing import Any
|
2018-01-12 09:10:43 +01:00
|
|
|
|
|
|
|
from django.core.management.base import BaseCommand
|
|
|
|
|
2018-05-23 05:40:28 +02:00
|
|
|
from zerver.lib.onboarding import create_if_missing_realm_internal_bots
|
2018-01-12 09:10:43 +01:00
|
|
|
|
2020-01-14 21:59:46 +01:00
|
|
|
|
2018-01-12 09:10:43 +01:00
|
|
|
class Command(BaseCommand):
|
2018-02-07 03:59:57 +01:00
|
|
|
help = """\
|
|
|
|
Create realm internal bots if absent, in all realms.
|
|
|
|
|
|
|
|
These are normally created when the realm is, so this should be a no-op
|
|
|
|
except when upgrading to a version that adds a new realm internal bot.
|
|
|
|
"""
|
|
|
|
|
2018-01-12 09:10:43 +01:00
|
|
|
def handle(self, *args: Any, **options: Any) -> None:
|
2018-05-23 05:40:28 +02:00
|
|
|
create_if_missing_realm_internal_bots()
|
|
|
|
# create_users is idempotent -- it's a no-op when a given email
|
|
|
|
# already has a user in a given realm.
|