mypy: Add clarifying variable in add_new_user.py.

This commit is contained in:
neiljp (Neil Pilgrim) 2017-12-24 19:44:56 +00:00 committed by Greg Price
parent 16b939a964
commit bed56b253e
1 changed files with 3 additions and 2 deletions

View File

@ -22,10 +22,11 @@ and will otherwise fall back to the zulip realm."""
if realm is None:
print('Warning: Using default zulip realm, which has an unusual configuration.\n'
'Try running `python manage.py add_new_realm`, and then running this again.')
realm = Realm.objects.get(string_id='zulip')
valid_realm = Realm.objects.get(string_id='zulip')
domain = 'zulip.com'
else:
valid_realm = realm
domain = realm.string_id + '.zulip.com'
name = '%02d-user' % (UserProfile.objects.filter(email__contains='user@').count(),)
do_create_user('%s@%s' % (name, domain), 'password', realm, name, name)
do_create_user('%s@%s' % (name, domain), 'password', valid_realm, name, name)