mirror of
https://github.com/zulip/zulip.git
synced 2025-11-16 03:41:58 +00:00
python: Reformat with Black, except quotes.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
committed by
Tim Abbott
parent
5028c081cb
commit
11741543da
@@ -13,11 +13,17 @@ class Command(ZulipBaseCommand):
|
||||
help = "Generate activation links for users and print them to stdout."
|
||||
|
||||
def add_arguments(self, parser: ArgumentParser) -> None:
|
||||
parser.add_argument('--force',
|
||||
action="store_true",
|
||||
help='Override that the domain is restricted to external users.')
|
||||
parser.add_argument('emails', metavar='<email>', nargs='*',
|
||||
help='email of users to generate an activation link for')
|
||||
parser.add_argument(
|
||||
'--force',
|
||||
action="store_true",
|
||||
help='Override that the domain is restricted to external users.',
|
||||
)
|
||||
parser.add_argument(
|
||||
'emails',
|
||||
metavar='<email>',
|
||||
nargs='*',
|
||||
help='email of users to generate an activation link for',
|
||||
)
|
||||
self.add_realm_args(parser, True)
|
||||
|
||||
def handle(self, *args: Any, **options: Any) -> None:
|
||||
@@ -46,11 +52,12 @@ class Command(ZulipBaseCommand):
|
||||
email_allowed_for_realm(email, realm)
|
||||
except DomainNotAllowedForRealmError:
|
||||
if not options["force"]:
|
||||
raise CommandError("You've asked to add an external user '{}' to a "
|
||||
"closed realm '{}'.\nAre you sure? To do this, "
|
||||
"pass --force.".format(email, realm.string_id))
|
||||
raise CommandError(
|
||||
"You've asked to add an external user '{}' to a "
|
||||
"closed realm '{}'.\nAre you sure? To do this, "
|
||||
"pass --force.".format(email, realm.string_id)
|
||||
)
|
||||
|
||||
prereg_user = PreregistrationUser(email=email, realm=realm)
|
||||
prereg_user.save()
|
||||
print(email + ": " + create_confirmation_link(prereg_user,
|
||||
Confirmation.INVITATION))
|
||||
print(email + ": " + create_confirmation_link(prereg_user, Confirmation.INVITATION))
|
||||
|
||||
Reference in New Issue
Block a user