mirror of
https://github.com/zulip/zulip.git
synced 2025-11-11 01:16:19 +00:00
This is a preparatory commit for using isort for sorting all of our imports, merging changes to files where we can easily review the changes as something we're happy with. These are also files with relatively little active development, which means we don't expect much merge conflict risk from these changes.
27 lines
924 B
Python
27 lines
924 B
Python
from argparse import ArgumentParser
|
|
from typing import Any
|
|
|
|
from zerver.lib.management import ZulipBaseCommand
|
|
|
|
|
|
class Command(ZulipBaseCommand):
|
|
help = """Show the admins in a realm."""
|
|
|
|
def add_arguments(self, parser: ArgumentParser) -> None:
|
|
self.add_realm_args(parser, required=True)
|
|
|
|
def handle(self, *args: Any, **options: Any) -> None:
|
|
realm = self.get_realm(options)
|
|
assert realm is not None # True because of required=True above
|
|
users = realm.get_admin_users_and_bots()
|
|
|
|
if users:
|
|
print('Admins:\n')
|
|
for user in users:
|
|
print(' %s (%s)' % (user.delivery_email, user.full_name))
|
|
else:
|
|
print('There are no admins for this realm!')
|
|
|
|
print('\nYou can use the "knight" management command to make more users admins.')
|
|
print('\nOr with the --revoke argument, remove admin status from users.')
|