views/users.py: Change error message to use Realm.string_id instead of domain.

This commit is contained in:
Rishi Gupta 2017-03-13 09:37:01 -07:00
parent 0559afb928
commit 00f49d4121
3 changed files with 4 additions and 4 deletions

View File

@ -309,7 +309,7 @@ def build_custom_checkers(by_lang):
]),
'exclude_line': set([
('zerver/views/users.py',
"return json_error(_(\"Email '%(email)s' does not belong to domain '%(domain)s'\") %"),
"return json_error(_(\"Email '%(email)s' not allowed for realm '%(realm)s'\") %"),
('zproject/settings.py',
"'format': '%(asctime)s %(levelname)-8s %(message)s'"),
]),

View File

@ -211,7 +211,7 @@ class AdminCreateUserTest(ZulipTestCase):
short_name='Romeo',
))
self.assert_json_error(result,
"Email 'romeo@not-zulip.com' does not belong to domain 'zulip.com'")
"Email 'romeo@not-zulip.com' not allowed for realm 'zulip'")
RealmAlias.objects.create(realm=get_realm('zulip'), domain='zulip.net')

View File

@ -345,8 +345,8 @@ def create_user_backend(request, user_profile, email=REQ(), password=REQ(),
# invited first.)
realm = user_profile.realm
if not email_allowed_for_realm(email, user_profile.realm):
return json_error(_("Email '%(email)s' does not belong to domain '%(domain)s'") %
{'email': email, 'domain': realm.domain})
return json_error(_("Email '%(email)s' not allowed for realm '%(realm)s'") %
{'email': email, 'realm': realm.string_id})
try:
get_user_profile_by_email(email)