export: Include huddles subscription from mirrordummy users.

If there are two huddles, with users A + B + C + D and A + B + C, and
user D is deleted, it is replaced with a mirrordummy user.  If
mirrordummy subscriptions are not included in exports, then the two
huddles have duplicate member sets, and will not be able to be
imported successfully.

Include huddle subscriptions for mirrordummy users in exports.
This commit is contained in:
Alex Vandiver
2023-07-07 19:50:44 +00:00
committed by Tim Abbott
parent d293e869bd
commit cfda414277

View File

@@ -1101,7 +1101,9 @@ def fetch_reaction_data(response: TableData, message_ids: Set[int]) -> None:
def custom_fetch_huddle_objects(response: TableData, context: Context) -> None: def custom_fetch_huddle_objects(response: TableData, context: Context) -> None:
realm = context["realm"] realm = context["realm"]
user_profile_ids = {r["id"] for r in response["zerver_userprofile"]} user_profile_ids = {
r["id"] for r in response["zerver_userprofile"] + response["zerver_userprofile_mirrordummy"]
}
# First we get all huddles involving someone in the realm. # First we get all huddles involving someone in the realm.
realm_huddle_subs = Subscription.objects.select_related("recipient").filter( realm_huddle_subs = Subscription.objects.select_related("recipient").filter(