settings: Allow admin to change email/name even if it is disabled in realm.

Allow realm admin users to change their email or name even,
changing name or email is disabled in realm.
This commit is contained in:
YJDave
2018-02-02 21:24:26 +05:30
committed by Tim Abbott
parent f0d651f9fe
commit ce46cd914a
7 changed files with 42 additions and 13 deletions

View File

@@ -127,6 +127,12 @@ class EmailChangeTestCase(ZulipTestCase):
self.assertEqual(result.status_code, 400)
self.assert_in_response("Email address changes are disabled in this organization.",
result)
# Realm admins can change their email address even setting is disabled.
data = {'email': 'iago-new@zulip.com'}
self.login(self.example_email("iago"))
url = '/json/settings'
result = self.client_patch(url, data)
self.assert_in_success_response(['Check your email for a confirmation link.'], result)
def test_email_change_already_taken(self) -> None:
data = {'email': 'cordelia@zulip.com'}