diff --git a/zerver/migrations/0021_migrate_attachment_data.py b/zerver/migrations/0021_migrate_attachment_data.py index 6757ae0fa9..a0df138637 100644 --- a/zerver/migrations/0021_migrate_attachment_data.py +++ b/zerver/migrations/0021_migrate_attachment_data.py @@ -20,7 +20,7 @@ def migrate_existing_data(apps, schema_editor): if owner == message.sender: if message.recipient.type == Recipient.STREAM: stream = Stream.objects.get(id=message.recipient.type_id) - is_realm_public = stream.realm.domain != "mit.edu" and not stream.invite_only + is_realm_public = not stream.realm.is_zephyr_mirror_realm and not stream.invite_only entry.is_realm_public = entry.is_realm_public or is_realm_public entry.save() diff --git a/zerver/migrations/0041_create_attachments_for_old_messages.py b/zerver/migrations/0041_create_attachments_for_old_messages.py index fe7fb00628..e7a9ff812f 100644 --- a/zerver/migrations/0041_create_attachments_for_old_messages.py +++ b/zerver/migrations/0041_create_attachments_for_old_messages.py @@ -25,7 +25,7 @@ def check_and_create_attachments(apps, schema_editor): is_message_realm_public = False if message.recipient.type == STREAM: stream = Stream.objects.get(id=message.recipient.type_id) - is_message_realm_public = not stream.invite_only and stream.realm.domain != "mit.edu" + is_message_realm_public = not stream.invite_only and not stream.realm.is_zephyr_mirror_realm if path_id is not None: attachment = Attachment.objects.create(