import: 'attachment_path' should be saved with the 's3_path' of the record.

For the S3 backend uploads, 'attachment_path' should be
saved with the 's3_path' of the record, as the original
'path' is changed while exporting files from s3. (See
function 'export_files_from_s3' in export.py for reference.)
This commit is contained in:
Rhea Parekh
2018-06-18 22:31:50 +05:30
parent 0730087111
commit 4d21f7f747

View File

@@ -345,7 +345,7 @@ def import_uploads_s3(bucket_name: str, import_dir: Path, processing_avatars: bo
sanitize_name(os.path.basename(record['path']))
])
key.key = s3_file_name
path_maps['attachment_path'][record['path']] = s3_file_name
path_maps['attachment_path'][record['s3_path']] = s3_file_name
user_profile_id = int(record['user_profile_id'])
# Support email gateway bot and other cross-realm messages