mirror of
https://github.com/element-hq/synapse.git
synced 2024-12-21 12:14:29 +03:00
fix PR review
This commit is contained in:
parent
ceec6ce5f4
commit
4311f861a3
1 changed files with 7 additions and 10 deletions
|
@ -160,14 +160,15 @@ if __name__ == "__main__":
|
||||||
default=None,
|
default=None,
|
||||||
help="New password for user. Will prompt if omitted.",
|
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",
|
"-a", "--admin",
|
||||||
action="store_true",
|
action="store_true",
|
||||||
help="Register new user as an admin. Will prompt if --regular-user is not set.",
|
help="Register new user as an admin. Will prompt if --no-admin is not set.",
|
||||||
)
|
)
|
||||||
parser.add_argument(
|
admin_group.add_argument(
|
||||||
"--regular-user",
|
"--no-admin",
|
||||||
action="store_true",
|
action="store_false",
|
||||||
help="Register new user as a regular user.",
|
help="Register new user as a regular user.",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -202,10 +203,6 @@ if __name__ == "__main__":
|
||||||
else:
|
else:
|
||||||
secret = args.shared_secret
|
secret = args.shared_secret
|
||||||
|
|
||||||
if args.admin and args.regular_user:
|
admin = args.admin or not args.no_admin or None
|
||||||
print "Both --admin and --regular-user are set, choose either."
|
|
||||||
sys.exit(1)
|
|
||||||
|
|
||||||
admin = True if args.admin else False if args.regular_user else None
|
|
||||||
|
|
||||||
register_new_user(args.user, args.password, args.server_url, secret, admin)
|
register_new_user(args.user, args.password, args.server_url, secret, admin)
|
||||||
|
|
Loading…
Reference in a new issue