diff options
author | David Baker <dave@matrix.org> | 2018-10-09 10:05:02 +0100 |
---|---|---|
committer | David Baker <dave@matrix.org> | 2018-10-09 10:05:02 +0100 |
commit | dc045ef20222bfbe8dcb5dae297e741509cce8d1 (patch) | |
tree | ee03ab45ce9791a06c12d15c01d3412cd101330a /scripts/register_new_matrix_user | |
parent | Apparently this blank line is Very Important (diff) | |
parent | Merge pull request #4017 from matrix-org/rav/optimise_filter_events_for_server (diff) | |
download | synapse-dc045ef20222bfbe8dcb5dae297e741509cce8d1.tar.xz |
Merge remote-tracking branch 'origin/develop' into dbkr/e2e_backups
Diffstat (limited to 'scripts/register_new_matrix_user')
-rwxr-xr-x | scripts/register_new_matrix_user | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/scripts/register_new_matrix_user b/scripts/register_new_matrix_user index 8c3d429351..91bdb3a25b 100755 --- a/scripts/register_new_matrix_user +++ b/scripts/register_new_matrix_user @@ -133,7 +133,7 @@ def register_new_user(user, password, server_location, shared_secret, admin): print "Passwords do not match" sys.exit(1) - if not admin: + if admin is None: admin = raw_input("Make admin [no]: ") if admin in ("y", "yes", "true"): admin = True @@ -160,10 +160,16 @@ if __name__ == "__main__": default=None, help="New password for user. Will prompt if omitted.", ) - parser.add_argument( + admin_group = parser.add_mutually_exclusive_group() + admin_group.add_argument( "-a", "--admin", action="store_true", - help="Register new user as an admin. Will prompt if omitted.", + help="Register new user as an admin. Will prompt if --no-admin is not set either.", + ) + admin_group.add_argument( + "--no-admin", + action="store_true", + help="Register new user as a regular user. Will prompt if --admin is not set either.", ) group = parser.add_mutually_exclusive_group(required=True) @@ -197,4 +203,8 @@ if __name__ == "__main__": else: secret = args.shared_secret - register_new_user(args.user, args.password, args.server_url, secret, args.admin) + admin = None + if args.admin or args.no_admin: + admin = args.admin + + register_new_user(args.user, args.password, args.server_url, secret, admin) |