From 7ec6a394fe8c9616cd8e1159a144e2700a359f18 Mon Sep 17 00:00:00 2001 From: Steve Howell Date: Tue, 9 Aug 2016 14:33:42 -0700 Subject: [PATCH] export: Filter Attachment objects by realm. --- zerver/lib/export.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zerver/lib/export.py b/zerver/lib/export.py index 7676c9ae2c..beb95dadb5 100644 --- a/zerver/lib/export.py +++ b/zerver/lib/export.py @@ -374,7 +374,7 @@ def export_uploads_local_helper(realm, output_dir, local_dir): count = 0 records = [] - for attachment in Attachment.objects.all(): + for attachment in Attachment.objects.filter(realm_id=realm.id): local_path = os.path.join(local_dir, attachment.path_id) output_path = os.path.join(output_dir, attachment.path_id) mkdir_p(os.path.dirname(output_path))