python: Reformat with Black, except quotes.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg
2021-02-11 23:19:30 -08:00
committed by Tim Abbott
parent 5028c081cb
commit 11741543da
817 changed files with 44952 additions and 24860 deletions

View File

@@ -14,9 +14,8 @@ class Command(ZulipBaseCommand):
self.add_user_list_args(parser, all_users_help="Add all users in realm to these streams.")
parser.add_argument(
'-s', '--streams',
required=True,
help='A comma-separated list of stream names.')
'-s', '--streams', required=True, help='A comma-separated list of stream names.'
)
def handle(self, **options: Any) -> None:
realm = self.get_realm(options)
@@ -28,8 +27,14 @@ class Command(ZulipBaseCommand):
for stream_name in set(stream_names):
for user_profile in user_profiles:
stream = ensure_stream(realm, stream_name, acting_user=None)
_ignore, already_subscribed = bulk_add_subscriptions(realm, [stream], [user_profile])
_ignore, already_subscribed = bulk_add_subscriptions(
realm, [stream], [user_profile]
)
was_there_already = user_profile.id in (info.user.id for info in already_subscribed)
print("{} {} to {}".format(
"Already subscribed" if was_there_already else "Subscribed",
user_profile.delivery_email, stream_name))
print(
"{} {} to {}".format(
"Already subscribed" if was_there_already else "Subscribed",
user_profile.delivery_email,
stream_name,
)
)