From 11346e50bb3eb471cc4c134254d0d64f66d33552 Mon Sep 17 00:00:00 2001 From: Rishi Gupta Date: Mon, 13 Mar 2017 09:44:32 -0700 Subject: [PATCH] management commands: Use Realm.string_id instead of domain in print statements. --- zerver/management/commands/deactivate_user.py | 2 +- zerver/management/commands/export.py | 2 +- zerver/management/commands/knight.py | 4 ++-- zerver/management/commands/realm_alias.py | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/zerver/management/commands/deactivate_user.py b/zerver/management/commands/deactivate_user.py index fa00086a79..0c5779d2d6 100644 --- a/zerver/management/commands/deactivate_user.py +++ b/zerver/management/commands/deactivate_user.py @@ -31,7 +31,7 @@ class Command(BaseCommand): print("Deactivating %s (%s) - %s" % (user_profile.full_name, user_profile.email, - user_profile.realm.domain)) + user_profile.realm.string_id)) print("%s has the following active sessions:" % (user_profile.email,)) for session in user_sessions(user_profile): print(session.expire_date, session.get_decoded()) diff --git a/zerver/management/commands/export.py b/zerver/management/commands/export.py index dab427d6d9..1a0e431322 100644 --- a/zerver/management/commands/export.py +++ b/zerver/management/commands/export.py @@ -122,7 +122,7 @@ class Command(BaseCommand): if os.path.exists(output_dir): shutil.rmtree(output_dir) os.makedirs(output_dir) - print("Exporting realm %s" % (realm.domain,)) + print("Exporting realm %s" % (realm.string_id,)) num_threads = int(options['threads']) if num_threads < 1: raise CommandError('You must have at least one thread.') diff --git a/zerver/management/commands/knight.py b/zerver/management/commands/knight.py index 391f3e0ae5..af0310d86a 100644 --- a/zerver/management/commands/knight.py +++ b/zerver/management/commands/knight.py @@ -54,7 +54,7 @@ ONLY perform this on customer request from an authorized person. print("Done!") else: print("Would have granted %s %s rights for %s" % ( - email, options['permission'], profile.realm.domain)) + email, options['permission'], profile.realm.string_id)) else: if profile.has_perm(options['permission'], profile.realm): if options['ack']: @@ -62,6 +62,6 @@ ONLY perform this on customer request from an authorized person. print("Done!") else: print("Would have removed %s's %s rights on %s" % (email, options['permission'], - profile.realm.domain)) + profile.realm.string_id)) else: raise CommandError("User did not have permission for this realm!") diff --git a/zerver/management/commands/realm_alias.py b/zerver/management/commands/realm_alias.py index 63ee07e016..a399d40d29 100644 --- a/zerver/management/commands/realm_alias.py +++ b/zerver/management/commands/realm_alias.py @@ -41,7 +41,7 @@ class Command(BaseCommand): # type: (*Any, **str) -> None realm = get_realm(options["string_id"]) if options["op"] == "show": - print("Aliases for %s:" % (realm.domain,)) + print("Aliases for %s:" % (realm.string_id,)) for alias in get_realm_aliases(realm): if alias["allow_subdomains"]: print(alias["domain"] + " (subdomains allowed)")