Limit Messages to those sent in this realm when prepopulating

(imported from commit af6312705bb43159e4448c16a9e05c00ca696ed5)
This commit is contained in:
Leo Franchi 2013-09-27 11:12:09 -04:00
parent 4102b8e844
commit b2a352da00
1 changed files with 1 additions and 1 deletions

View File

@ -320,7 +320,7 @@ def accounts_register(request):
# tutorial.
recipients = Recipient.objects.filter(type=Recipient.STREAM,
type_id__in=[stream.id for stream in streams])
messages = Message.objects.filter(recipient_id__in=recipients).order_by("-id")[0:100]
messages = Message.objects.filter(recipient_id__in=recipients, sender__realm=realm).order_by("-id")[0:100]
if len(messages) > 0:
ums_to_create = [UserMessage(user_profile=user_profile, message=message,
flags=UserMessage.flags.read)