change_user_role: List role choices in --help output.

Fixes #28227.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg 2023-12-14 14:40:34 -08:00 committed by Tim Abbott
parent 6e902defba
commit b472d769d1
1 changed files with 13 additions and 11 deletions

View File

@ -13,6 +13,17 @@ from zerver.actions.users import (
from zerver.lib.management import ZulipBaseCommand from zerver.lib.management import ZulipBaseCommand
from zerver.models import UserProfile from zerver.models import UserProfile
ROLE_CHOICES = [
"owner",
"admin",
"moderator",
"member",
"guest",
"can_forge_sender",
"can_create_users",
"is_billing_admin",
]
class Command(ZulipBaseCommand): class Command(ZulipBaseCommand):
help = """Change role of an existing user in their (own) Realm. help = """Change role of an existing user in their (own) Realm.
@ -26,17 +37,8 @@ ONLY perform this on customer request from an authorized person.
parser.add_argument( parser.add_argument(
"new_role", "new_role",
metavar="<new_role>", metavar="<new_role>",
choices=[ choices=ROLE_CHOICES,
"owner", help="new role of the user; choose from " + ", ".join(ROLE_CHOICES),
"admin",
"moderator",
"member",
"guest",
"can_forge_sender",
"can_create_users",
"is_billing_admin",
],
help="new role of the user",
) )
parser.add_argument( parser.add_argument(
"--revoke", "--revoke",