Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

create_user: Use None as default for --password, --password-file.

Anders Kaseorgddcf8dd8bc92
diff --git a/zerver/management/commands/create_user.py b/zerver/management/commands/create_user.py
index 2575e711218..71b378b4ffa 100644
--- a/zerver/management/commands/create_user.py
+++ b/zerver/management/commands/create_user.py
@@ -26,14 +26,12 @@ Omit both <email> and <full name> for interactive user creation.
action="store_true",
help='Acknowledgement that the user has already accepted the ToS.')
parser.add_argument('--password',
- default='',
help='password of new user. For development only.'
'Note that we recommend against setting '
'passwords this way, since they can be snooped by any user account '
'on the server via `ps -ef` or by any superuser with'
'read access to the user\'s bash history.')
parser.add_argument('--password-file',
- default='',
help='The file containing the password of the new user.')
parser.add_argument('email', metavar='<email>', nargs='?', default=argparse.SUPPRESS,
help='email address of new user')
@@ -71,10 +69,10 @@ parameters, or specify no parameters for interactive user creation.""")
full_name = input("Full name: ")
try:
- if options['password_file']:
+ if options['password_file'] is not None:
with open(options['password_file']) as f:
pw = f.read()
- elif options['password']:
+ elif options['password'] is not None:
pw = options['password']
else:
user_initial_password = initial_password(email)