actions.py: Remove transaction.atomic from do_start_email_change_process.

Don't think it's necessary?
This commit is contained in:
Rishi Gupta 2017-06-10 13:49:07 -07:00 committed by Tim Abbott
parent ea6a04781b
commit 215568aae2
2 changed files with 10 additions and 11 deletions

View File

@ -636,17 +636,16 @@ def do_start_email_change_process(user_profile, new_email):
'new_email': new_email,
}
with transaction.atomic():
obj = EmailChangeStatus.objects.create(new_email=new_email,
old_email=old_email,
user_profile=user_profile,
realm=user_profile.realm)
obj = EmailChangeStatus.objects.create(new_email=new_email,
old_email=old_email,
user_profile=user_profile,
realm=user_profile.realm)
EmailChangeConfirmation.objects.send_confirmation(
obj, 'zerver/emails/confirm_new_email', new_email,
additional_context=context,
host=user_profile.realm.host,
)
EmailChangeConfirmation.objects.send_confirmation(
obj, 'zerver/emails/confirm_new_email', new_email,
additional_context=context,
host=user_profile.realm.host,
)
def compute_irc_user_fullname(email):
# type: (NonBinaryStr) -> NonBinaryStr

View File

@ -268,7 +268,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, 47)
self.assert_length(queries, 46)
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)