From 50e14dbe972e3d909d1198482636943a6efb9933 Mon Sep 17 00:00:00 2001 From: Hudda Date: Fri, 28 Dec 2018 12:48:34 +0530 Subject: [PATCH] list_realms: Print the full domains of the organizations. This adds a column to display the full domains of realms. Tweaked by tabbott to use fewer columns. Fixes part of #11015. --- zerver/management/commands/list_realms.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/zerver/management/commands/list_realms.py b/zerver/management/commands/list_realms.py index 8f17a5b77a..fc9f747527 100644 --- a/zerver/management/commands/list_realms.py +++ b/zerver/management/commands/list_realms.py @@ -24,20 +24,24 @@ Usage examples: def handle(self, *args: Any, **options: Any) -> None: realms = Realm.objects.all() - outer_format = "%-5s %-40s %-40s" + outer_format = "%-5s %-20s %-30s %-50s" inner_format = "%-40s %s" deactivated = False if not options["all"]: - print(outer_format % ("id", "string_id", "name")) - print(outer_format % ("--", "---------", "----")) + print(outer_format % ("id", "string_id", "name", "domain")) + print(outer_format % ("--", "---------", "----", "------")) for realm in realms: if realm.deactivated: - print(self.style.ERROR(outer_format % (realm.id, realm.string_id, realm.name))) + print(self.style.ERROR(outer_format % ( + realm.id, + realm.string_id, + realm.name, + realm.uri))) deactivated = True else: - print(outer_format % (realm.id, realm.string_id, realm.name)) + print(outer_format % (realm.id, realm.string_id, realm.name, realm.uri)) if deactivated: print(self.style.WARNING("\nRed rows represent deactivated realms.")) sys.exit(0)