registration.py: Remove first_in_realm from accounts_register.

The parent commit implies first_in_realm == realm_creation.
This commit is contained in:
Rishi Gupta 2017-08-04 23:48:20 -07:00 committed by Tim Abbott
parent ddbf8b9c3c
commit 251bd3e577
2 changed files with 2 additions and 3 deletions

View File

@ -276,7 +276,7 @@ class LoginTest(ZulipTestCase):
with queries_captured() as queries:
self.register(self.nonreg_email('test'), "test")
# Ensure the number of queries we make is not O(streams)
self.assert_length(queries, 68)
self.assert_length(queries, 67)
user_profile = self.nonreg_user('test')
self.assertEqual(get_session_dict_user(self.client.session), user_profile.id)
self.assertFalse(user_profile.enable_stream_desktop_notifications)

View File

@ -199,7 +199,6 @@ def accounts_register(request):
full_name = form.cleaned_data['full_name']
short_name = email_to_username(email)
first_in_realm = len(UserProfile.objects.filter(realm=realm, is_bot=False)) == 0
timezone = u""
if 'timezone' in request.POST and request.POST['timezone'] in get_all_timezones():
@ -221,7 +220,7 @@ def accounts_register(request):
send_initial_pms(user_profile)
if first_in_realm:
if realm_creation:
do_change_is_admin(user_profile, True)
setup_initial_private_stream(user_profile)
send_initial_realm_messages(realm)