mirror of https://github.com/zulip/zulip.git
change_user_role: List role choices in --help output.
Fixes #28227. Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
parent
6e902defba
commit
b472d769d1
|
@ -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",
|
||||||
|
|
Loading…
Reference in New Issue