diff --git a/templates/zerver/api_content.json b/templates/zerver/api_content.json index d180fac70e..ab5360a195 100644 --- a/templates/zerver/api_content.json +++ b/templates/zerver/api_content.json @@ -99,7 +99,6 @@ 'avatar_url': 'https://url/for/othello-bots/avatar', 'timestamp': 1375978404, 'display_recipient': [{'full_name': 'Hamlet of Denmark', - 'domain': 'example.com', 'email': 'hamlet@example.com', 'short_name': 'hamlet', 'id': 31572}], diff --git a/zerver/lib/actions.py b/zerver/lib/actions.py index fcee7a87cb..5842f1e8b5 100644 --- a/zerver/lib/actions.py +++ b/zerver/lib/actions.py @@ -703,9 +703,8 @@ def get_recipient_user_profiles(recipient, sender_id): 'user_profile__email', 'user_profile__enable_online_push_notifications', 'user_profile__is_active', - 'user_profile__realm__domain' ] - query = Subscription.objects.select_related("user_profile", "user_profile__realm").only(*fields).filter( + query = Subscription.objects.select_related("user_profile").only(*fields).filter( recipient=recipient, active=True) recipients = [s.user_profile for s in query] else: @@ -2846,7 +2845,7 @@ def gather_subscriptions_helper(user_profile, include_subscribers=True): stream_ids = set([sub["recipient__type_id"] for sub in sub_dicts]) all_streams = get_active_streams(user_profile.realm).select_related( "realm").values("id", "name", "invite_only", "realm_id", - "realm__domain", "email_token", "description") + "email_token", "description") stream_dicts = [stream for stream in all_streams if stream['id'] in stream_ids] stream_hash = {} diff --git a/zerver/lib/message.py b/zerver/lib/message.py index 8681296144..47316ffa37 100644 --- a/zerver/lib/message.py +++ b/zerver/lib/message.py @@ -172,7 +172,6 @@ class MessageDict(object): # add the sender in if this isn't a message between # someone and his self, preserving ordering recip = {'email': sender_email, - 'domain': sender_realm_domain, 'full_name': sender_full_name, 'short_name': sender_short_name, 'id': sender_id, diff --git a/zerver/models.py b/zerver/models.py index 2e9b16f0ce..b05c68a92a 100644 --- a/zerver/models.py +++ b/zerver/models.py @@ -93,7 +93,6 @@ def get_display_recipient_remote_cache(recipient_id, recipient_type, recipient_t .select_related() .order_by('email')) return [{'email': user_profile.email, - 'domain': user_profile.realm.domain, 'full_name': user_profile.full_name, 'short_name': user_profile.short_name, 'id': user_profile.id,